Permalink
Browse files

jwplayer on popcorn side, so far.

  • Loading branch information...
1 parent 474204c commit 5803b6df6c464cc8d33c73d94fea66aef1714d47 @ScottDowne ScottDowne committed Apr 1, 2013
@@ -393,13 +393,29 @@
// Default to using HTML5 video. Similar to the HTMLVideoElement
// wrapper, we put a video in the div passed to us via:
// Popcorn.smart( div, src, options )
- var videoHTML, videoID = Popcorn.guid( "popcorn-video-" ),
+ var videoHTML,
+ videoElement,
+ videoID = Popcorn.guid( "popcorn-video-" ),
videoHTMLContainer = document.createElement( "div" );
videoHTMLContainer.style.width = "100%";
videoHTMLContainer.style.height = "100%";
- node.appendChild( videoHTMLContainer );
+ // If we only have one source, do not bother with source elements.
+ // This means we don't have the IE9 hack,
+ // and we can properly listen to error events.
+ // That way an error event can be told to backup to Flash if it fails.
+ if ( src.length === 1 ) {
+ videoElement = document.createElement( "video" );
+ videoElement.id = videoID;
+ node.appendChild( videoElement );
+ setTimeout( function() {
+ videoElement.src = src[ 0 ];
+ }, 0 );
+ return Popcorn( '#' + videoID, options );
+ }
+
+ node.appendChild( videoHTMLContainer );
// IE9 doesn't like dynamic creation of source elements on <video>
// so we do it in one shot via innerHTML.
videoHTML = '<video id="' + videoID + '" preload=auto autobuffer>';
View
@@ -44,6 +44,7 @@
},
"wrappers": {
"HTMLYouTubeVideoElement": "wrappers/youtube/popcorn.HTMLYouTubeVideoElement.unit.html",
+ "HTMLJWPlayerVideoElement": "wrappers/jwplayer/popcorn.HTMLJWPlayerVideoElement.unit.html",
"HTMLSoundCloudAudioElement": "wrappers/soundcloud/popcorn.HTMLSoundCloudAudioElement.unit.html",
"HTMLVimeoVideoElement": "wrappers/vimeo/popcorn.HTMLVimeoVideoElement.unit.html",
"HTMLNullVideoElement": "wrappers/null/popcorn.HTMLNullVideoElement.unit.html",
Oops, something went wrong.

0 comments on commit 5803b6d

Please sign in to comment.