Skip to content

Commit

Permalink
a fail new try
Browse files Browse the repository at this point in the history
  • Loading branch information
keyanr committed Oct 3, 2011
1 parent 8cb78f7 commit a246b64
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
10 changes: 10 additions & 0 deletions plugins/subtitle/popcorn.subtitle.html
Expand Up @@ -5,6 +5,14 @@
<script src="../../popcorn.js"></script>
<script src="popcorn.subtitle.js"></script>
<script>
var output;

document.addEventListener( "DOMContentLoaded", function() {
var p = Popcorn( "#video" , {
pauseOnLinkClicked: true
})
.play();
}, false);
document.addEventListener( "DOMContentLoaded", function() {
var p = Popcorn( "#video" )
.volume( 0 )
Expand Down Expand Up @@ -43,6 +51,8 @@ <h1 id="qunit-header">Popcorn Subtitle Plug-in Demo</h1>
<p>Your user agent does not support the HTML5 Video element.</p>

</video>

<button onclick=''>test</button>
</div>

</body>
Expand Down
17 changes: 17 additions & 0 deletions plugins/subtitle/popcorn.subtitle.js
Expand Up @@ -140,3 +140,20 @@
});

})( Popcorn );
document.addEventListener( "click", function( event ) {

var targetElement = event.target;
var ctxContainer = context.container = document.createElement( "div" ),
style = ctxContainer.style;


//Some browsers use an element as the target, some use the text node inside
if ( targetElement.nodeName === "A" || targetElement.parentNode && targetElement.parentNode.nodeName === "A" ) {
Popcorn.instances.forEach( function( video ) {
if ( video.options.pauseOnLinkClicked ) {
// style.color = "blue";
video.pause();
}
});
}
}, false );

0 comments on commit a246b64

Please sign in to comment.