【发布时间】:2021-10-01 19:32:45
【问题描述】:
我正在尝试在 Chromecast 上启动一个 mp4 流,该流还显示字幕(vtt 文件)
我看到它被添加到本机库中。但是我找不到用于将其发送到接收器应用程序的有效负载消息。我没有使用 Android 和 iOS 的原生库,而是使用有效负载消息而不是原生库的 Flutter 版本。 -> https://github.com/jonathantribouharet/flutter_cast
这是我已经尝试过的。
{
'type': 'LOAD',
'autoPlay': true,
'currentTime': currentTime,
'media': {
'contentId': url,
'contentType': 'video/mp4',
'streamType': 'BUFFERED',
'metadata': {
'type': 0,
'metadataType': 0,
'title': title,
'images': [
{
'url': posterUrl,
}
],
},
},
'customData': {
'cc': {
'tracks': [
{'src': 'https://gist.githubusercontent.com/samdutton/ca37f3adaf4e23679957b8083e061177/raw/e19399fbccbc069a2af4266e5120ae6bad62699a/sample.vtt'},
],
'active': 0
},
},
}
这是我的完整应用程序: https://github.com/vanlooverenkoen/flutter_cast_ui/tree/feature/cast-ui
但是自定义数据没有做任何事情。
我发现的所有 StackOverflow 问题都来自 2014 年。从那时起,ClosedCaptions 或字幕应该可以通过 3 种文件格式实现:WebVTT、TTML 和 CEA-608。
- https://developers.google.com/cast/docs/web_receiver/tracks#closed_captions_subtitles
- https://developers.google.com/cast/docs/media#subtitles_and_closed_captions
本文档用于播放/暂停/停止实现:
- https://developers.google.com/cast/docs/reference/messages
- https://docs.rs/crate/gcast/0.1.5/source/PROTOCOL.md
我已经看到的 Stackoveflow 问题:
【问题讨论】:
标签: android ios flutter chromecast google-cast