Closed GoogleCodeExporter closed 9 years ago
[deleted comment]
it looks like I mixed up
https://developers.google.com/cast/docs/reference/receiver/cast.receiver.media.P
layer#load
and
https://developers.google.com/cast/docs/reference/player/cast.player.api.Player#
load
anyway I still have the problem that setting autoplay to false is not working
anymore in a custom receiver.
when I set mediaElement.autoplay = false and then call
cast.player.api.Player#load(protocol, offset) the video still starts playing
after some buffer time
Original comment by p...@zattoo.com
on 3 Mar 2015 at 5:43
It is recommended that autoplay is configured using the media namespace from
the sender. If you want to control it in your receiver directly then you can
refer to this sample:
https://github.com/googlecast/CastVideosPlaylist-chrome/blob/master/player_playl
ist_receiver.html
You can also have a look at our reference receiver on how to handle autoplay:
https://github.com/googlecast/Cast-Player-Sample.
Please let us know if the issue still persist and we can reopen it.
Original comment by na...@google.com
on 3 Mar 2015 at 11:03
that is what I'm doing. the sender sets the autoplay property in the
LoadRequest, but because I need support for adaptive streams I have a custom
receiver with a custom onLoad callback where I need to handle autoplay on my
own.
my reference for this was this code:
https://github.com/googlecast/cast-custom-receiver/blob/master/sample_media_rece
iver.html#L465-L523
but autoplay is not handled in there. it's just always true.
this is how I did it in the onLoad callback which used to work but is not
anymore (simplified):
mediaManager.onLoad = function (event) {
var autoplay = (event.data.autoplay === false ? false : true); // default to autoplay = true
mediaElement.autoplay = autoplay;
mediaHost = new cast.player.api.Host({mediaElement: mediaElement, url: event.data.media.contentId});
mediaPlayer = new cast.player.api.Player(mediaHost);
protocol = cast.player.api.CreateSmoothStreamingProtocol(mediaHost);
mediaPlayer.load(protocol, 123);
};
it always autoplays, even when the LoadRequest has autoplay value of false
Original comment by p...@zattoo.com
on 4 Mar 2015 at 9:09
sorry I used the wrong protocol in the last comment. most of the time we use HLS
Original comment by p...@zattoo.com
on 4 Mar 2015 at 9:13
There's no known bug in MPL related to autoplay. Also, we could not repro the
issue with the information provided. Please make sure that the player is
unloading properly between loads and try debugging at your end.
If the issue persist, please provide a sample (and other relevant info) which
would help reproduce the issue. We'd be glad to help you with it.
Original comment by na...@google.com
on 4 Mar 2015 at 10:06
ok found it. some refactoring introduced that mediaElement.autoplay got set
before doing mediaPlayer.unload() which was before the other way around.
reverting that change fixed it.
but I'm still not sure why the mediaPlayer is not respecting the value of
mediaElement.autoplay when it is still "running" (not unloaded before or never
load()ed).
it should work in both ways which is currently not the case.
anyway thanks for your feedback!
Original comment by p...@zattoo.com
on 6 Mar 2015 at 3:06
Original issue reported on code.google.com by
p...@zattoo.com
on 3 Mar 2015 at 5:10