문제

I am using the Chromecast companion library in an app to stream video and it is working well but now I want to add captions to the video but I cannot find how to do this. I have seen the captions example for chrome but there does not appear to be an equivalent for android, I tried copying the json from the chrome example and adding it to the customdata in the load media function but this did not work.

How do I add captions to a video using the chromecast android api?

도움이 되었습니까?

해결책

Currently, none of the sender's Cast SDKs provide any APIs to support closed captioning, so you need to roll out your own solution. Most of the work is done on the receiver side and you can find an example of that among our sample codes; there you'll see a chrome sender and a receiver code but when you look at the sender code, you can see that doing the same from an Android or iOS device is more or less the same. As a side note, we have plans to support CC as part of our SDK, at which time, our Styled and Default receivers will be updated accordingly.

Update (1/10/2017): Media Tracks/Closed captions have been added to the sender and receiver SDKs a while ago. For Android senders, you can look at the docs to see how it can be set up. Both CCL and SDK v3 (as part of ExpandedController) provide UI controls to let user change the track. If you are working with CCL, then you also can add a full set of preferences to earlier versions of Android that allow user to customize the look ad feel of the CC (such as fonts, etc); newer versions of the Android have that built into the settings. Both CastVideos-android and CastVideos-android-v2 samples use CC.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top