- Sold between 50 000 and 100 000 dollars
- Author was Featured
- Author had a Free File of the Month
- Exclusive Author
- Repeatedly Helped protect Envato Marketplaces against copyright violations
- Europe
- Has been a member for 3-4 years
- Referred between 10 and 49 users
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 
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;
}
- United States
- Has been a member for 4-5 years
- Exclusive Author
- Author was Featured
- Sold between 50 000 and 100 000 dollars
- Item was Featured
- Contributed a Tutorial to a Tuts+ Site
- Author had a Free File of the Month
You could try SoundMixer.stopAll();
This issue shows that the youtube destroy function just isn’t built correctly.
- Sold between 50 000 and 100 000 dollars
- Has been a member for 5-6 years
- Microlancer Beta Tester
- United Kingdom
- Attended a Community Meetup
- Author was Featured
- Item was Featured
- Referred between 200 and 499 users
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
Looks like they made some changes and messed it up…but mute also fixes the issue here.
- Sold between 50 000 and 100 000 dollars
- Author was Featured
- Author had a Free File of the Month
- Exclusive Author
- Repeatedly Helped protect Envato Marketplaces against copyright violations
- Europe
- Has been a member for 3-4 years
- Referred between 10 and 49 users
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 codeLooks 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.
- Sold between 100 000 and 250 000 dollars
- Author had a File in an Envato Bundle
- Has been a member for 4-5 years
- Author had a Free File of the Month
- Won a Competition
- Author was Featured
- Item was Featured
- Bought between 10 and 49 items
my guess is, the fucser is still playing in the background so mute won’t solve the problem
- Sold between 50 000 and 100 000 dollars
- Author was Featured
- Author had a Free File of the Month
- Exclusive Author
- Repeatedly Helped protect Envato Marketplaces against copyright violations
- Europe
- Has been a member for 3-4 years
- Referred between 10 and 49 users
Obvioulsy it does play in the background, what have they done, who knows… this reminds me of Vimeo 
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
- Sold between 100 000 and 250 000 dollars
- Author had a File in an Envato Bundle
- Has been a member for 4-5 years
- Author had a Free File of the Month
- Won a Competition
- Author was Featured
- Item was Featured
- Bought between 10 and 49 items
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()
}
}
}
}
- Sold between 50 000 and 100 000 dollars
- Author was Featured
- Author had a Free File of the Month
- Exclusive Author
- Repeatedly Helped protect Envato Marketplaces against copyright violations
- Europe
- Has been a member for 3-4 years
- Referred between 10 and 49 users
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.
- Sold between 100 000 and 250 000 dollars
- Author had a File in an Envato Bundle
- Has been a member for 4-5 years
- Author had a Free File of the Month
- Won a Competition
- Author was Featured
- Item was Featured
- Bought between 10 and 49 items
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.
