我从(https://github.com/kutu/GrindPlayer)下载了grind player的源代码,然后按照该页面上给出的步骤操作。在我安装nginx并创建一个html页面以运行Grind播放器之后。来自grind player site(http://osmfhls.kutu.ru/docs/grind/#embed)我使用swfobject在html页面中嵌入了grind player。现在播放器被添加到我的页面,我能够在研磨播放器中运行视频,但问题是我不知道如何添加.srt文件以在grind中运行。作为我的html页面的以下代码的参考,我添加了'subtitle'变量并将其传递给变量'parameter',该参数在swfobject中传递。请指导我哪里出错了?
// Collect query parameters in an object that we can
// forward to SWFObject:
var subtitles = JSON.stringify({
subtitles: [
{
src: "Closedcaption_atsc_rollup.srt" // url to .srt file
, label: "English" // label for subtitles, will show in menu
, language:"en" // optional
}
]
// optinal, configuration to display subtitles
// all properties by default, you can change only what you need
, config: {
// fontSize, in percentage of available width
// for GrindPlayer available width for subtitles is 70% of player width
// ex: if player width is 1280px, then real fontSize will be
// Math.floor(1280 * 0.7 * 0.035) = 31
fontSize: 0.035
, minFontSize: 20
, maxFontSize: 36
, textColor: 0xDFDFDF
, bgColor: 0x101010
, bgAlpha: 0.8
}
});
var pqs = new ParsedQueryString();
var parameterNames = pqs.params(false);
var parameters = {
//src: "http://streambox.fr/playlists/test_001/stream.m3u8",
//src: "http://localhost:8082/playlists/test_001/stream.m3u8",
src:"mission.mp4",
//src:"sample.mp4",
//src:"galliyan.mp4",
autoPlay: "true",
verbose: true,
controlBarAutoHide: "true",
controlBarPosition: "bottom",
poster: "images/poster.png",
javascriptCallbackFunction: "jsbridge",
plugin_hls: "../../bin/release/flashlsOSMF.swf",
hls_minbufferlength: -1,
hls_maxbufferlength: 300,
hls_lowbufferlength: 3,
hls_seekmode: "KEYFRAME",
hls_startfromlevel: -1,
hls_seekfromlevel: -1,
hls_live_flushurlcache: false,
hls_info: true,
hls_debug: false,
hls_debug2: false,
hls_warn: true,
hls_error: true,
hls_fragmentloadmaxretry : -1,
hls_manifestloadmaxretry : -1,
hls_capleveltostage : false,
hls_maxlevelcappingmode : "downscale",
"src_http://kutu.ru/osmf/plugins/subtitles": encodeURIComponent(subtitles)
};