Skip to content
Permalink
Browse files

Lightbox: Added support for auto-playing videos in a lightbox

  • Loading branch information...
masterbee committed Nov 21, 2014
1 parent 56b0311 commit 1b05e9db0c15dd3105299ee5106d32095d57ceb8
Showing with 13 additions and 1 deletion.
  1. +4 −1 src/plugins/lightbox/lightbox.js
  2. +9 −0 src/plugins/multimedia/multimedia.js
@@ -164,7 +164,10 @@ var componentName = "wb-lbx",
$content.attr( "role", "document" );
}

$wrap.append( "<span tabindex='0' class='lbx-end wb-inv'></span>" );
$wrap.append( "<span tabindex='0' class='lbx-end wb-inv'></span>" )
.find( ".activate-open" )
.trigger( "wb-activate" );

},
change: function() {
var $item = this.currItem,
@@ -890,6 +890,15 @@ $document.on( "keyup", selector, function( event ) {
}
});

// TODO: recode with a more efficient to use the API than DOM crawling
$document.on( "wb-activate", selector, function( event ) {
var playerTarget = event.currentTarget,
ctrls = ".wb-mm-ctrls",
ref = expand( playerTarget ),
$this = ref[ 0 ];
$this.find( ctrls + " .playpause" ).trigger( "click" );
});

$document.on( "durationchange play pause ended volumechange timeupdate " +
captionsLoadedEvent + " " + captionsLoadFailedEvent + " " +
captionsVisibleChangeEvent + " " + cuepointEvent +

0 comments on commit 1b05e9d

Please sign in to comment.
You can’t perform that action at this time.