I'm trying to create a clip from a video. which have fixed start and end time. So when I click on the button then the video should start from the given time. Here's my code
<link href="{{asset('../videojs/videojs-resolution-switcher.css')}}" rel="stylesheet">
<link href="{{asset('../videojs/video-js.min.css')}}" rel="stylesheet">
<script src="{{asset('../videojs/video.js')}}"></script>
<script src="{{asset('../videojs/videojs-resolution-switcher.js')}}"></script>
<script src="{{asset('../videojs/videojs-offset.min.js')}}"></script>
<script src="{{asset('../videojs/Youtube.min.js')}}"></script>
function setSegmentTime(e)
{
var start_time = $(e).data("start-time");
var end_time = $(e).data("end-time");
var myplayer = videojs('demo-video');
myplayer.offset({
start: start_time,
end: end_time,
restart_beginning: false //Should the video go to the beginning when it ends
});
myplayer.play();
}
In this, I have used a plugin for playing a segment of the video but it is also not working. It may be the videojs version issue. https://github.com/cladera/videojs-offset
My question is that, can I play a video at a given time without using above plugin. I have checked everywhere but none of the solution is working. Thanks in advance.