javascript - How to use the code plugin with popcornjs -


I'm making my first move with popcornes and I'm trying to use it, but to make sure Not to do this

I gave an example, and found the video to play, but I can not use the plugin

index.html:

  & lt; Script src = "bower_components / popcornjs / popcorn.js" & gt; & Lt; / Script & gt; & Lt; Script src = "bower_components / popcornjs / wrappers / common / popcorn.mediaElementProto.js" & gt; & Lt; / Script & gt; & Lt; Script src = "bower_components / popcornjs / wrappers / youtube / popcorn.HTMLYouTubeVideoElement.js" & gt; & Lt; / Script & gt; & Lt; Script src = "bower_components / popcornjs / plugins / code / popcorn.code.js" & gt; & Lt; / Script & gt;  

Media.js

  $ scope.player = popcorn.HTMLYouTubeVideoElement ("#media-player"); $ Scope.player src = "http://www.youtube.com/watch?v=DaN2Y2-wNSs";  

// The following lines failed

  // $ scope.player.code ({// start: Popcorn.util.toSeconds (2), / / Onstart: Function () {// console.log ("I am here");}}};  

// There is no way 'code' in object #

How do I use the plugin?

Cheers

It is not working because you did not actually wind up to make a popcorn example Naming conventions behind the rapper are somewhat misleading and maybe it

When you create a new HTMLYouTubeVideoElement object that will control the basic player interaction along with the YouTube video. To create a popcorn example with it, you can pass that object to the popcorn bus pass. Your code should look like the following:

  $ scope.player = new popcorn.HTMLYouTubeVideoElement ("#media-player"); $ scope.player src = "http: //www.youtube.com/watch?v=DaN2Y2-wNSs "; $ scope.player = new popcorn Not ($ scope. Player); $ Scope.player.code ({start: Popcorn.util.toSeconds (2), Onstart: Function () {console.log ("I'm Here");}});  

This will create a new HTMLYouTubeVideoElement object and then pass it to popcorn and make a popcorn example. Examples of popcorn are necessary to add new events to the video.


Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -