1

I am trying to provide closed caption support with Chromecast for my iOS app. The files are in segmented WebVTT format(with .m3u8 extension). But the videos are hosted in a CDN and closed caption files hosted on a separate server. The URLs for these WebVTT files are provided separately and not part of video master playlist. These subtitles are working with native iOS player but not with Chromecast.

I tried hosting a normal WebVTT (non-segmented) file on the same server where segmented WebVTT file is hosted and it works fine. So, the problem is with the segmented WebVTT.

So, is it possible to get the segmented WebVTT files working with Chromecast if they are hosted separately. I am using a Custom receiver. Do I need to add anything to receiver file specifically to support this?

This is how I create the media track for closed caption :

GCKMediaTrack *track = [[GCKMediaTrack alloc] initWithIdentifier:1
                                           contentIdentifier:@"https://domain_name/track_name.m3u8"
                                                 contentType:@"text/webvtt"
                                                        type:GCKMediaTrackTypeText
                                                 textSubtype:GCKMediaTextTrackSubtypeCaptions
                                                        name:@"English"
                                                languageCode:@"en-US"
                                                  customData:nil];

If we pass an individual segment like this it works properly.

GCKMediaTrack *track = [[GCKMediaTrack alloc] initWithIdentifier:1
                                           contentIdentifier:@"https://domain_name/segments/track_index.webvtt"
                                                 contentType:@"text/webvtt"
                                                        type:GCKMediaTrackTypeText
                                                 textSubtype:GCKMediaTextTrackSubtypeCaptions
                                                        name:@"English"
                                                languageCode:@"en-US"
                                                  customData:nil];
4

1 回答 1

0

在发布这个问题将近五年后,我今天遇到了完全相同的事情。

以下字幕播放列表:

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-PLAYLIST-TYPE:VOD
#EXT-X-TARGETDURATION:7310
#EXT-X-MEDIA-SEQUENCE:0
#EXTINF:7309.400000,
https://undertekst.nrk.no/prod/MSUB19/12/MSUB19121216AW/MIX/MSUB19121216AW-v2.vtt
#EXT-X-DISCONTINUITY
#EXTINF:5891.920000,
https://undertekst.nrk.no/prod/MSUB19/12/MSUB19121216BW/TTV/MSUB19121216BW-v2.vtt
#EXT-X-ENDLIST

使 chromecast 将这两个部分重叠显示。但在 iOS 设备上,它们与预期的 7309.4 秒有偏差,并一个接一个地显示。

于 2019-08-01T08:51:01.993 回答