1676 posts Envato Elite Author
  • Elite Author
  • Sold between 100 000 and 250 000 dollars
  • Author had a Free File of the Month
  • Exclusive Author
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Europe
  • Has been a member for 4-5 years
  • Referred between 10 and 49 users
+1 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;

            }
5311 posts The Dude Abides
  • United States
  • Exclusive Author
  • Has been a member for 5-6 years
  • Elite Author
  • Bought between 100 and 499 items
  • Referred between 100 and 199 users
  • Author had a Free File of the Month
+5 more
CodingJack says

You could try SoundMixer.stopAll();

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

1312 posts
  • Elite Author
  • Sold between 50 000 and 100 000 dollars
  • Has been a member for 6-7 years
  • Envato Studio (Microlancer) Beta Tester
  • United Kingdom
  • Attended a Community Meetup
  • Referred between 200 and 499 users
+3 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.

1676 posts Envato Elite Author
  • Elite Author
  • Sold between 100 000 and 250 000 dollars
  • Author had a Free File of the Month
  • Exclusive Author
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Europe
  • Has been a member for 4-5 years
  • Referred between 10 and 49 users
+1 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.

1999 posts
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Author had a File in an Envato Bundle
  • Has been a member for 5-6 years
  • Author had a Free File of the Month
  • Won a Competition
  • Bought between 10 and 49 items
+4 more
bitfade says

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

1676 posts Envato Elite Author
  • Elite Author
  • Sold between 100 000 and 250 000 dollars
  • Author had a Free File of the Month
  • Exclusive Author
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Europe
  • Has been a member for 4-5 years
  • Referred between 10 and 49 users
+1 more
Tean says

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

4140 posts
  • Bought between 1 and 9 items
  • Brazil
  • Exclusive Author
  • Has been a member for 6-7 years
  • Referred between 1 and 9 users
  • Sold between 5 000 and 10 000 dollars
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

1999 posts
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Author had a File in an Envato Bundle
  • Has been a member for 5-6 years
  • Author had a Free File of the Month
  • Won a Competition
  • Bought between 10 and 49 items
+4 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()
            }
        }
    }
}

1676 posts Envato Elite Author
  • Elite Author
  • Sold between 100 000 and 250 000 dollars
  • Author had a Free File of the Month
  • Exclusive Author
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Europe
  • Has been a member for 4-5 years
  • Referred between 10 and 49 users
+1 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.

1999 posts
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Author had a File in an Envato Bundle
  • Has been a member for 5-6 years
  • Author had a Free File of the Month
  • Won a Competition
  • Bought between 10 and 49 items
+4 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