Skip to content
This repository was archived by the owner on Jan 31, 2018. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 83 additions & 0 deletions public/templates/assets/plugins/sequencer/popcorn.sequencer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<!DOCTYPE html>
<html>
<head>
<title>Popcorn Subtitle Plug-in Demo</title>
<script src="../../../../external/popcorn-js/popcorn.js"></script>
<script src="../../../../external/popcorn-js/wrappers/common/popcorn._MediaElementProto.js"></script>
<script src="../../../../external/popcorn-js/wrappers/null/popcorn.HTMLNullVideoElement.js"></script>
<script src="../../../../external/popcorn-js/wrappers/youtube/popcorn.HTMLYouTubeVideoElement.js"></script>
<script src="../../../../external/popcorn-js/modules/player/popcorn.player.js"></script>
<script src="../../../../external/popcorn-js/players/youtube/popcorn.youtube.js"></script>
<script src="popcorn.sequencer.js"></script>
<script src="../../../../external/require/require.js"></script>
<link href="../../../../css/controls.css" rel="stylesheet">
<style>
.video {
height: 100%;
position: relative;
width: 100%;
z-index: 1;
background-color: #FFF;
}
.controls {
background: none repeat scroll 0 0 white;
border: 1px solid #D5D6D5;
bottom: 0;
height: 41px;
left: 0;
opacity: 1;
position: absolute;
right: 0;
visibility: visible;
z-index: 2;
}
</style>
<script>
document.addEventListener( "DOMContentLoaded", function() {
var p = Popcorn.smart( "#video", "#t=,120", { frameAnimation: true } )
.volume( 0 )
.sequencer({
start: 0,
end: 90,
target: "video",
width: 50,
zindex: 2,
duration: 90,
source: "http://www.youtube.com/watch?v=QZB7OFRUrA0"
})
.sequencer({
start: 30,
end: 120,
target: "video",
left: 50,
width: 50,
zindex: 3,
duration: 90,
source: "http://www.youtube.com/watch?v=QZB7OFRUrA0"
});

var require = requirejs.config({
baseUrl: "../../../../src",
paths: {
"text": "../external/require/text"
}
});

define( "sequencer-example", [ "ui/widget/controls" ], function( Controls ) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can change this to require([ "ui/widget/controls" ], function( Controls ) { and remove the require statement below

p.controls( true );
Controls.create( "controls", p );
});
require(["sequencer-example"]);
}, false);
</script>
</head>
<body>
<h1>Popcorn Sequencer Plug-in Demo</h1>
<div>
<div id="video" style="position: relative; height: 200px; width: 500px;">
<div class="video"></div>
</div>
<div id="controls" class="controls"><div>
</div>
</body>
</html>
20 changes: 15 additions & 5 deletions public/templates/assets/plugins/sequencer/popcorn.sequencer.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,26 @@
target.appendChild( container );
};
options.displayLoading = function() {
var bigPlay = document.getElementById( "controls-big-play-button" );
var bigPlay = document.getElementById( "controls-big-play-button" ),
loadingMessage = document.querySelector( ".loading-message" );
_this.on( "play", options._surpressPlayEvent );
if ( bigPlay ) {
bigPlay.classList.add( "hide-button" );
}
document.querySelector( ".loading-message" ).classList.add( "show-media" );
if ( loadingMessage ) {
loadingMessage.classList.add( "show-media" );
}
};
options.hideLoading = function() {
var bigPlay = document.getElementById( "controls-big-play-button" );
var bigPlay = document.getElementById( "controls-big-play-button" ),
loadingMessage = document.querySelector( ".loading-message" );
_this.off( "play", options._surpressPlayEvent );
if ( bigPlay ) {
bigPlay.classList.remove( "hide-button" );
}
document.querySelector( ".loading-message" ).classList.remove( "show-media" );
if ( loadingMessage ) {
loadingMessage.classList.remove( "show-media" );
}
};

if ( !options.from || options.from > options.duration ) {
Expand Down Expand Up @@ -362,6 +368,10 @@
return options.title || options.source || "";
};

if ( !options.duration ) {
options.duration = 0;
}

if ( options.duration > 0 &&
options.end - ( options.start - ( +options.from ) ) > options.duration ) {
options.end = options.duration + ( options.start - ( +options.from ) );
Expand All @@ -388,7 +398,7 @@
if ( updates.title ) {
options.title = updates.title;
}
if ( updates.denied ) {
if ( updates.hasOwnProperty( "denied" ) ) {
options.denied = updates.denied;
}
if ( updates.hasOwnProperty( "hidden" ) ) {
Expand Down