来自javascript API的Flowplayer字幕不起作用

时间:2014-07-14 07:47:03

标签: javascript flowplayer

我正在使用flowplayer v5.4.6。我正在通过flowplayer javascript API初始化我的视频播放器。视频播放和工作正常。我通过提示点和字幕实体提供了字幕。问题是流程播放器没有渲染字幕。这是我的代码

function initVideoPlayer(pMedia, jsonData) {
var title = "title 1";
var subtitles = [];
var entry = {
    title: title,
    startTime: seconds("00:00:01.000"),
    endTime: seconds("00:00:02.000"),
    text: "<p>The first subtitle </p><br/>"
};
subtitles.push(entry);
var cue = {
    time: entry.startTime,
    subtitle: entry
};
jsonData.cuepoints.push(cue);
jsonData.cuepoints.push({
    time: entry.endTime,
    subtitleEnd: title
});

title = "title 2";
entry = {
    title: title,
    startTime: seconds("00:00:03.000"),
    endTime: seconds("00:00:05.000"),
    text: "<p>The second subtitle</p><br/>"
};
subtitles.push(entry);
cue = {
    time: entry.startTime,
    subtitle: entry
};
jsonData.cuepoints.push(cue);
jsonData.cuepoints.push({
    time: entry.endTime,
    subtitleEnd: title
});

$(pMedia).flowplayer({
    adaptiveRatio: true,
    playlist: [jsonData.sources],
    cuepoints: jsonData.cuepoints
}).one('ready', function (ev, api) {
    api.resume();
});

}

我检查了流程员代码。我发现流程图检查cuepoints进度事件并从每个cuepoint触发cuepoint事件。但事件处理程序代码的范围不同。在该处理程序中,它通过cuepoint处理字幕。这可能是cuepoints无法通过javascript API工作的原因。

有人使用过API的字幕或遇到过类似的问题吗?任何形式的帮助将不胜感激。

0 个答案:

没有答案