1677 posts Envato Elite Author
  • Has referred 10+ members
  • Has sold $125,000+ on Envato Market
  • Has collected 1+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+6 more
Tean says

Have anybody used this recently?

There is some weird bug I havent noticed before. If you destroy the player during the video play, all is well. However, if ENDED _STATE fires and then you destroy the player, the sound from the video plays again.

I have isolated the case, so its not part of some big app in case something else is causing the problem.

The only way I am currently able to prevent this is to mute player on end, before destroying it.

I clean the player, and remove it from the stage afterwards, however the audio plays again :D

if(_player){

    _player.mute();
    _player.stopVideo();

                _player.removeEventListener("onReady", onPlayerReady); 
                _player.removeEventListener("onError", onPlayerError);
                _player.removeEventListener("onStateChange", onPlayerStateChange); 
                _player.removeEventListener("onPlaybackQualityChange", onVideoPlaybackQualityChange);

                _player.destroy();
                _player = null;

            }
5361 posts The Dude Abides
  • Located in United States
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $125,000+ on Envato Market
  • Has been part of the Envato Community for over 5 years
+9 more
CodingJack says

You could try SoundMixer.stopAll();

This issue shows that the youtube destroy function just isn’t built correctly.

1312 posts
  • Has referred 200+ members
  • Has sold $75,000+ on Envato Market and is now an Elite Author
  • Has been a beta tester for an Envato feature
  • Has collected 100+ items on Envato Market
+8 more
LGLab says

hmm this is a new problem, wasn’t happening before, but it also now happens with my files although I haven’t touched the code :D Looks like they made some changes and messed it up…but mute also fixes the issue here.

1677 posts Envato Elite Author
  • Has referred 10+ members
  • Has sold $125,000+ on Envato Market
  • Has collected 1+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+6 more
Tean says
LGLab said
hmm this is a new problem, wasn’t happening before, but it also now happens with my files although I haven’t touched the code :D Looks like they made some changes and messed it up…but mute also fixes the issue here.

Exactly, I figured out they changes something because I havent touch my code either.

2002 posts
  • Has referred 50+ members
  • Has sold $500,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+9 more
bitfade says

my guess is, the fucser is still playing in the background so mute won’t solve the problem

1677 posts Envato Elite Author
  • Has referred 10+ members
  • Has sold $125,000+ on Envato Market
  • Has collected 1+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+6 more
Tean says

Obvioulsy it does play in the background, what have they done, who knows… this reminds me of Vimeo :D

4140 posts
  • Has been part of the Envato Community for over 6 years
  • Has referred 1+ members
  • Has sold $5,000+ on Envato Market
  • Located in Brazil
+3 more
tsafi says

my guess when they done with 3D Content api on the final update early this month, then things start to get screw as they mess with the sound class or add the stereo mode with the webm …but hey its only my guess

2002 posts
  • Has referred 50+ members
  • Has sold $500,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+9 more
bitfade says

the bug is nothing new, destroy doesn’t always work, player ignores it and keep doing his things.

if (killPlayerLoop == null) {
    killPlayerLoop = Run.every(0.1,killTheDamnPlayers)                
}

....

protected static function killTheDamnPlayers(e:Event = null) {
    if (players) {
        for (var i:uint = 0; i<players.length;i++) {
            if (players[i].getPlayerState() != -1) {
                players[i].stopVideo()
            }
        }
    }
}

1677 posts Envato Elite Author
  • Has referred 10+ members
  • Has sold $125,000+ on Envato Market
  • Has collected 1+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+6 more
Tean says

No, something else is going on, read my explanation again.

When video comes to an end (STATE_ENDED) and you destroy the player, the sound from the video starts playing again from the beginning.

So you have started the video again, repeated, looped or whatever. Its like the video loops, but you dont see the video, you just hear audio.

I am pretty sure I havent seen this before.

2002 posts
  • Has referred 50+ members
  • Has sold $500,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+9 more
bitfade says

i suspect the bug is in the stopVideo/destroy combo, now it restarts playback once video is ended, while before it wasn’t stopping.

the latter could be avoided by keep calling stopVideo() until status = -1 and only then destroy the player, my guess is the same workaround could work in the above situation.

by
by
by
by
by
by