2015-11-21 63 views
0

如果我想創建函數來提醒此代碼中的標題名稱,如何編寫函數來提醒它,而不包括jwplayer庫到我的HTML文件?如何閱讀Javascript配置模式?

http://jsfiddle.net/fs7p0ec4/1/

jwplayer("my_media_player").setup({ 
 
\t image: "http://example.com/poster.jpg", 
 
\t title: "testHLS", 
 
\t rtmp: { bufferlength: "2" }, 
 
\t bufferlength: "2", 
 
\t width: "100%", 
 
\t aspectratio : "16:9", 
 
\t playlist: [{sources: [ { file: "http://example.com/playlist.m3u8" } ]}], 
 
primary: "flash", 
 
repeat: true, 
 
controlbar: true, 
 
stretching: "exactfit" 
 
});

+0

爲了澄清,你不想'jwplayer.js'在你的實際網頁?意思是你不想把 \t' ' 在頁面上? – zer00ne

+0

是的,我不想把jwplayer.js放在頁面 – Sun

+0

我知道的唯一方法就是使用JW平臺。在[ARTICLE](http://support.jwplayer.com/customer/en/portal/articles/1406723-basic-video-embed) – zer00ne

回答

0
var jwplayerClass = function(xx){ } 
jwplayerClass.prototype.setup = function(info) { 
    var XWP = info.playlist[0].sources[0].file; 
    alert(XWP); return this 
}; 
var jwplayer = function (xx) { 
    return new jwplayerClass(xx); 
};