0

Return to Video shows on snippet after pressing stop on MediaPlayer

I have code that takes a user to a fullscreenView, which then renders a mediaplayer to play a video. When the user presses Stop, it then takes the user back to the previous screen, which is the correction functionality.

However, when I then bring up the dock, it displays "Return to Video" on the snippet even though the video is stopped. If I choose to return to video, it takes me to a blank fullscreen mediaplayer, for a few seconds before going back to the correct screen.

Here is my code:

by
  • Ad
  • Apr 23, 2012
3 Replies
  • code:

    _backToDoubleGridView: function () {
    if (!this._previousViewHasBeenCalled){
    this._previousViewHasBeenCalled = true;
    this._unregisterHandlers(); a
    KONtx.application.loadView('view-DoubleGrid');
    //KONtx.application.previousView();
    }
    }

    //different function
    switch(event.type) {

                case 'onPlaylistEnd':

                    event.preventDefault();

                     KONtx.mediaplayer.control.stop();

                    this._backToDoubleGridView();

                    break;

                case 'onStreamLoadError':

                    this.dialogs.error.show();

                    break;

                case 'onStopRemoteKeyPress':

                    //event.preventDefault();

                    currentAppData.set("userStopped", "true"); //Used to
    make sure we don't push them back (sidebar cancel edge case)   

                    KONtx.mediaplayer.control.stop();
                    //this._backToDoubleGridView();
                    break;
                case 'onControlStop':

                    //event.preventDefault();

                    currentAppData.set("userStopped", "true"); //Used to
    make sure we don't push them back (sidebar cancel edge case)

                    this._backToDoubleGridView();
                    break;
                default:
                    break;
            }
        }
    0
  • So there's a correction here, If i choose return to video, it takes me to a blank fullscreen mediaplyer, and I actively have to choose stop again to go back to the screen before the video player started. The playlist is empty, because I hit play, nothing plays.

    The goal is not have to "Return to Video" shown in the snippet, after pressing stop the first time.


    QUOTE(Ad @ 23 Apr 2012 4:28 PM)
    I have code that takes a user to a fullscreenView, which then renders a mediaplayer to play a video. When the user presses Stop, it then takes the user back to the previous screen, which is the correction functionality.

    However, when I then bring up the dock, it displays "Return to Video" on the snippet even though the video is stopped. If I choose to return to video, it takes me to a blank fullscreen mediaplayer, for a few seconds before going back to the correct screen.

    Here is my code:
    0
  • Why are you cancelling the stop event? You are the Vanguard cinema widget developer, right? If so, there is the code to handle the addition/removal of the "Return to video" snippet in your event_handlers.js but the removal doesn't happen since you cancel the event when state changes to STOP and therefore the code in the event_handlers.js(method handlePlayerEvent) doesn't get called. Therefore you see the 'Return to video" snippet. This snippet should go away if the player is in STOP/UNKNOWN/ERROR/EOF states.

    Thanks,
    Vivek
    0

Recent Posts

in General - Yahoo! TV Widgets