[#1453] Better control for destroying down wrappers. #302

Open
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants
Contributor

ScottDowne commented Mar 18, 2013

No description provided.

@mjschranz mjschranz commented on the diff Mar 21, 2013

wrappers/youtube/popcorn.HTMLYouTubeVideoElement.js
elem = document.createElement( "div" );
}
function changeSrc( aSrc ) {
+
+ if ( !aSrc ) {
+ impl.src = aSrc;
+ if( playerReady ) {
@mjschranz

mjschranz Mar 21, 2013

Contributor

You don't really need these if checks for playerReady. destroyPlayer() already will bail early if https://github.com/mozilla/popcorn-js/blob/master/wrappers/youtube/popcorn.HTMLYouTubeVideoElement.js#L290-L292 is met.

@mjschranz mjschranz commented on the diff Mar 21, 2013

wrappers/youtube/popcorn.HTMLYouTubeVideoElement.js
@@ -388,7 +399,17 @@
}
function monitorCurrentTime() {
- var playerTime = player.getCurrentTime();
+ var playerTime;
+
+ if ( !parent.parentNode || !impl.src ) {
+ if( playerReady ) {
@mjschranz

mjschranz Mar 21, 2013

Contributor

See above comment.

@mjschranz mjschranz commented on the diff Mar 21, 2013

wrappers/youtube/popcorn.HTMLYouTubeVideoElement.js
@@ -401,7 +422,16 @@
}
function monitorBuffered() {
- var fraction = player.getVideoLoadedFraction();
+ var fraction;
+
+ if ( !parent.parentNode || !impl.src ) {
+ if( playerReady ) {
@mjschranz

mjschranz Mar 21, 2013

Contributor

Above comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment