隐藏式字幕/字幕不适用于AVPlayer但在Safari:HLS中

时间:2015-06-15 21:26:47

标签: ios cocoa-touch safari media avplayer

我正在构建一个使用Apple的HLS实现的应用程序。我们使用的m3u8文件如下所示:

day 19 ID 1
day 19 ID 2
day 19 ID 3
day 20 ID 1
day 20 ID 2
day 20 ID 3

如您所见,它有一个字幕和一个媒体流。这在Safari中完美运行,“英语”标题按预期显示在列表中。

在我们的应用程序中实现AVPlayer时,这不起作用。出现视频流和字幕按钮,但不存在“英语”选项。

Apple的示例m3u8文件确实可以工作,但我不明白为什么这会在Safari中运行而不是在AVPlayer中。

非常感谢任何帮助。

干杯, 史蒂夫

1 个答案:

答案 0 :(得分:0)

您是否尝试将Button1添加到protected void Button1_Click(object sender, EventArgs e) { //a list of values handled is stored in ViewState as ValuesHandled List<string> handledValues = new List<string>(); if (ViewState["ValuesHandled"] != null) { List<string> handledValues = (ViewState["ValuesHandled"] as List<string>; } for (int i = 1; i <= 10; i++) { string a = "A" + i.ToString(); //check if i = 4 has had its values input successfully if (i == 4 && !handledValues.Contains(i.ToString())) { loop = true; ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop", "openModal();", true); handledValues.Add(i.toString()); //break the loop since we need to return to browser for input by user break; } else if (i == 4 && handledValues.Contains(i.ToString())) { //remove handled value if no modal popup needed to be opened handledValues.Remove(i.ToString()) } else if (i == 5 && !handledValues.Contains(i.ToString())) {//check if i = 5 has had its values input successfully loop = true; handledValues.Add(i.toString()); ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop", "openModal();", true); //break the loop since we need to return to browser for input by user break; } else if (i == 5 && handledValues.Contains(i.ToString())) { //remove handled value if no modal popup needed to be opened handledValues.Remove(i.ToString()) } else { List.Add(a); } } //update the ViewState for ValuesHandled ViewState["ValuesHandled"] = handledValues; } 行? e.g。

LANGUAGE

这是来自Apple的示例播放列表:

#EXT-X-MEDIA