will1971 / google-cast-sdk

Automatically exported from code.google.com/p/google-cast-sdk
0 stars 0 forks source link

Progress bar stays on screen during casting #754

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Start playback of a video using RemoteMediaPlayer.load() passing in a 
playPosition of zero (0).
2. Start playback of a second video using the same method passing in a 
playPosition of zero (0).

What is the expected output? What do you see instead?
I expected the second video to start playback with the progress bar not on 
screen. Instead the progress bar stays on the cast screen until the media 
completes or a seek is performed.

What version of the product are you using? On what operating system?
Google play services version: 8.4.0 (8.4.89 (2428711-440) on the actual device) 
Android version: 6.0.1

Please provide any additional information below.
I've implemented a workaround in my app by passing in a playPosition of 1 
instead of 0, but if I pass in zero or omit the parameter completely the 
progress bar will stay on screen on any video loaded using the 
RemoteMediaPlayer.load() method after the first video is loaded.

Original issue reported on code.google.com by AngelJ...@gmail.com on 5 Feb 2016 at 9:29

GoogleCodeExporter commented 8 years ago
Could you please reply to our queries below.
1. Were you facing this issue recently? If so, let us know on which cast SDK 
the problem started?
2. Please share feedback report from Chromecast app/extension with the text 
"for Issue 754" in description and share receiver logs here (after reproducing 
this issue). 
3. If possible, can you please share sample code for which you are observing 
the issue along with the logs? If code sharing is not possible, please share 
atleast cast related sender side logs.
4. Did you try with latest MediaPlayer Library(1.0.0.25)?
5. Also try to check demo code sample 
(https://github.com/googlecast/CastVideos-android) for playing queued videos?
6. Which Chromecast device are you using - Chromecast generation 1 or 2? Also, 
please share the firmware on the same

Original comment by vinot...@google.com on 16 Feb 2016 at 9:42

GoogleCodeExporter commented 8 years ago
Additional Queries
1. What type of receiver are you using (Default, styled or custom)?
2. Can you share the sample stream you are using?

Original comment by vinot...@google.com on 17 Feb 2016 at 10:54

GoogleCodeExporter commented 8 years ago
1. I've been seeing this off and on all along but wasn't able to reproduce it 
effectively until recently using the version I mentioned above. I am not sure 
what version I started with last August, but I've had the problem since then.

2. I sent a feedback report from the Chromecast while it was playing with the 
progress bar stuck on screen.

3. Code block below.

4. I am using the default receiver right now.

5. I am not queuing videos up, I'm loading each individual as the user selects 
them. The app itself is a "Presentation" type app to help users present media 
during a lesson or talk. The videos aren't queued in sequence and are instead 
loaded when the user specifies they are ready for the next media item.

6. I can reproduce this on both a 1st and 2nd gen Chromecast and a Nexus 
Player. I haven't tested on any other devices.

Additional Queries
1. I am using the default receiver right now. We will likely move to a custom 
receiver in the future but we haven't gotten to that point yet. 

2. I can reproduce this with any stream I've tried though I'm not sure I can 
share the stream used in the feedback report publicly.

If I can help in any way or you want me to expand on the above, please let me 
know. 

This is the block of code I use to initialize the remote media player and to 
set the media:

    private RemoteMediaPlayer remoteMediaPlayer;
    private StopWatch approximatePositionStopWatch = new StopWatch();
    private long storedSeekPosition = 0;

    /**
     * Creates the {@link #remoteMediaPlayer} object, setting up the listeners.
     * If the mediaInfo has already been set, we will use it to load the remote
     * media
     */
    private void initializeRemoteMediaPlayer() {
        remoteMediaPlayer = new RemoteMediaPlayer();

        //Add the listeners
        remoteMediaPlayer.setOnStatusUpdatedListener(remoteListener);
        remoteMediaPlayer.setOnMetadataUpdatedListener(remoteListener);

        //Register the communication channel
        try {
            Cast.CastApi.setMessageReceivedCallbacks(client, DEFAULT_NAMESPACE, remoteMediaPlayer);
        } catch (Exception e) {
            Log.d(TAG, "Unable to add cast callbacks due to ", e);
        }

        //Make sure we set the content at the appropriate time
        if (mediaInfo != null) {
            setMedia(mediaInfo);
        }

        performPoll();
    }

/**
     * Sets the media information to use for casting the media
     * to the Google Cast device
     * @param mediaInfo The MediaInfo representing the media item
     * @param autoplay Whether or not the media should autoplay when loaded.
     */
    public void setMedia(MediaInfo mediaInfo, boolean autoplay) {
        if (remoteMediaPlayer != null) {
            remoteMediaPlayer.load(client, mediaInfo, autoplay, storedSeekPosition)
                    .setResultCallback(remoteLoadResultCallback);
            approximatePositionStopWatch.reset();
            remoteListener.resetStates();
        }

        this.mediaInfo = mediaInfo;
    }

Original comment by AngelJ...@gmail.com on 18 Feb 2016 at 4:10

GoogleCodeExporter commented 8 years ago
We are looking into the issue and will update soon

Original comment by vinot...@google.com on 18 Feb 2016 at 7:06