Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change video and end callback inside angular controller #62

Open
sanjib-dev opened this issue Jan 14, 2017 · 3 comments
Open

change video and end callback inside angular controller #62

sanjib-dev opened this issue Jan 14, 2017 · 3 comments

Comments

@sanjib-dev
Copy link

sanjib-dev commented Jan 14, 2017

Please advice how to implement this functionalities.
this is my start initialization - working fine
$scope.media_setup = { sources: [ { src: "https://d24uab5gycr2uz.cloudfront.net/stockmarketexperts-output/output/lecture-3-video-3-factors-of-fundamental-analysis-sd.m3u8", type: "application/x-mpegURL", } ] };

then

$scope.changeVideo = function(){ $scope.playInstance.media_setup = { sources: [ { src: "https://d24uab5gycr2uz.cloudfront.net/stockmarketexperts-output/output/lecture-3-video-3-factors-of-fundamental-analysis-sd.m3u8", type: "application/x-mpegURL", } ] }; };

$scope.$on('vjsVideoReady',function(e,data){ $scope.playInstance = data.player; });
this is not working

tried also
$scope.$on('$destroy',function(){
$scope.playInstance.dispose();
});

still no luck

display file

<video id="my_video_1"  class="video-js vjs-default-skin" controls preload="auto" width="640" height="268" vjs-media="media_setup" vjs-video vjs-setup='{ "playbackRates": [0.5, 1, 1.5, 2] }'>
        
    </video>

    <button ng-click="changeVideo()">Change</button>
@sanjib-dev sanjib-dev changed the title change video and end callback inside angukar controller change video and end callback inside angular controller Jan 14, 2017
@sanjib-dev
Copy link
Author

manage to make this work like this which mentioned in an earlier post
$scope.$on('vjsVideoReady',function(e,data){
$scope.playInstance = data.player;
$scope.playInstance.on('ended',function(e){
console.log('ended');
});
});

@ghost
Copy link

ghost commented Jan 15, 2017

@sanjib-dev So are you trying to play another video after the first one ends? If so, you can do this using vjs-media as mentioned in #13. Let me know if that works for you.

@sanjib-dev
Copy link
Author

I am trying to load a new video if user clicks on the next item.
my initial problem is resolved, but now can it be possible to change vjs-setup inside angular controller?
as i tried to load my custom playlist with local videos as well as youtube videos
one more thing.. can it be possible to add a adaptive control bar. i am using m3u8 master playlist to play videos with contrib-hls plugin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant