I am currently exploring the world of Popcornjs and attempting to utilize the code plugin. However, I am facing some challenges in implementing it successfully.
After following this example and managing to get the video to play, I found myself unable to effectively use the plugin.
Here is a snippet from my Index.html:
<script src="bower_components/popcornjs/popcorn.js"></script>
<script src="bower_components/popcornjs/wrappers/common/popcorn._MediaElementProto.js"></script>
<script src="bower_components/popcornjs/wrappers/youtube/popcorn.HTMLYouTubeVideoElement.js"></script>
<script src="bower_components/popcornjs/plugins/code/popcorn.code.js"></script>
Within Media.js:
$scope.player = Popcorn.HTMLYouTubeVideoElement( "#media-player" );
$scope.player.src = "http://www.youtube.com/watch?v=DaN2Y2-wNSs";
// The lines below are causing issues
//$scope.player.code({
// start: Popcorn.util.toSeconds( 2 ),
// onStart: function () {
// console.log( "I am here" );
// }
//});
// Object # has no method 'code'
Any tips on correctly utilizing the plugin would be greatly appreciated!
Cheers