Ticket #757 (closed bug: fixed)

Opened 3 years ago

Last modified 3 years ago

Investigate YouTube media provider state issue

Reported by: zach Owned by: pablo
Priority: Milestone: Flash 5.2
Component: Keywords:
Cc: pablo@…, jeroen@… Forum thread:

Description

From an e-mail:

I ran into another asynchronous issue I believe is related to the original problem below (in this case, I'm using a player with the control bar hidden so the only means of interacting is clicking the video for play/pause or triggering a carousel switch which uses JavaScript to stop the video before moving on). When a video is playing with the YouTubeMediaProvider and a plugin or (in my case) the JavaScript API triggers a stop event:

players[curVideo].sendEvent("STOP"); --- LOG (V4 emulator sending event: STOP {})

...most of the time, you will get expected behavior:

JWPLAYERPLAYERSTATE ([PlayerStateEvent type="jwplayerPlayerState" oldstate="PLAYING" newstate="IDLE" id="null" client="FLASHMAC 10,0,42,34" version="5.1.824" message="null"])

...however some of the time, you get this:

JWPLAYERPLAYERSTATE ([PlayerStateEvent type="jwplayerPlayerState" oldstate="PLAYING" newstate="IDLE" id="null" client="FLASHMAC 10,0,42,34" version="5.1.824" message="null"]) JWPLAYERPLAYERSTATE ([PlayerStateEvent type="jwplayerPlayerState" oldstate="IDLE" newstate="PLAYING" id="null" client="FLASHMAC 10,0,42,34" version="5.1.824" message="null"]) JWPLAYERMEDIATIME ([MediaEvent type="jwplayerMediaTime" duration="212" position="1.3" id="null" client="FLASHMAC 10,0,42,34" version="5.1.824"])

The effect of which is that the player triggers the stopped/idle state, shows the static image and the play button for a brief instant, and then reverts to (what appears to be a) paused state with the static image hidden and the play button also hidden, with the video not reset to its start point. A click on the video brings the play button back, and a subsequent click begins playback from the beginning of the video. So if you're 15 seconds in and send a stop event and get this odd behavior, the player essentially appears paused at 15 seconds in, two clicks later it starts playing from the beginning.

My assumption is that when YouTubeMediaProvider.as's stop() function is called, it communicates to the chromeless player that it wants a stop, then triggers the super class's stop method which fires the PlayerState.IDLE event, continues to send data for a moment while actually waiting for the chromeless player to stop, which enters the onTimeChange function, which calls super.play(), since the current PlayerState is not PLAYING, and then actually stops. At this point, I would assume it sends -1 to onStateChange, but I see that case -1: setState(PlayerState.IDLE); is currently commented out.

Is there any particular reason why -1 in onStateChange was commented out(?), because it makes the most sense for this behavior to occur here and not to call super.stop() in YouTubeMediaProvider's stop function so that there isn't a chance to enter onTimeChange again.

Change History

comment:1 Changed 3 years ago by zach

  • Cc pablo@…, jeroen@… added; pablo jeroen removed

comment:2 Changed 3 years ago by pablo

  • Owner set to pablo
  • Status changed from new to assigned

comment:3 Changed 3 years ago by pablo

  • Status changed from assigned to closed
  • Resolution set to fixed

Fixed in 974

Note: See TracTickets for help on using tickets.