Chromecast SDK (Android) - is there a way to check whether the media playing on the cast device has finished playing?

前端 未结 3 1072
予麋鹿
予麋鹿 2020-12-21 01:31

Is there an onFinished listener of some sort? Or do we have to compare the current stream position against the duration of the track?

3条回答
  •  生来不讨喜
    2020-12-21 01:38

    Prem, There is currently no callback to register for such event. One alternative (and-not-so-pretty) approach is the following: on the receiver, listen for "ended" event of the media element and send an event back to the sender through a private channel. Another approach is what you suggested: check position against duration. When SDK graduates to general availability, better and cleaner approaches will be available to accomplish what you want.

提交回复
热议问题