2013-04-02 51 views
0

我是HTML5和JQuery的新手。我遇到以下媒體播放器:用於HTML5的開放式標準媒體播放器(http://mediafront.org/osmplayer/)。但是當我試圖在我的html頁面中包含播放器時,播放器沒有運行。可能的原因是什麼? PFB用於包含播放器的代碼。包括HTML5中的開放標準媒體播放器

<!-- Include the core jQuery and jQuery UI --> 
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> 
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js"></script> 

<!-- Include the core media player JavaScript. --> 
<script type="text/javascript" src="osmplayer/bin/osmplayer.compressed.js"></script> 

<!-- Include the DarkHive ThemeRolller jQuery UI theme. --> 
<link rel="stylesheet" href="osmplayer/jquery-ui/dark-hive/jquery-ui-1.8.18.custom.css"> 
<!-- Include the Default template CSS and JavaScript. --> 
<link rel="stylesheet" href="osmplayer/templates/default/css/osmplayer_default.css"> 
<link rel="stylesheet" href="osmplayer/templates/default/osmplayer.default.js"> 

回答

0

我有同樣的問題。我檢查了osmplayer頁面並複製了在那裏製作的所有腳本和樣式表引用,並進行了調整以匹配我自己代碼中的文件系統。

<!-- Include the core media player JavaScript. --> 
<script type="text/javascript" src="../../public/osmplayer/bin/osmplayer.compressed.js"></script> 

<!-- Include the DarkHive ThemeRolller jQuery UI theme. --> 
<link rel="stylesheet" href="../../public/osmplayer/jquery-ui/dark-hive/jquery-ui-1.8.18.custom.css"> 

<script type="text/javascript" src="../../public/osmplayer/minplayer/src/minplayer.compatibility.js"></script> 
<script type="text/javascript" src="../../public/osmplayer/minplayer/src/minplayer.flags.js"></script> 
<script type="text/javascript" src="../../public/osmplayer/minplayer/src/minplayer.async.js"></script> 
<script type="text/javascript" src="../../public/osmplayer/minplayer/src/minplayer.plugin.js"></script> 
<script type="text/javascript" src="../../public/osmplayer/minplayer/src/minplayer.display.js"></script> 
<script type="text/javascript" src="../../public/osmplayer/minplayer/src/minplayer.js"></script> 
<script type="text/javascript" src="../../public/osmplayer/minplayer/src/minplayer.image.js"></script> 
<script type="text/javascript" src="../../public/osmplayer/minplayer/src/minplayer.file.js"></script> 
<script type="text/javascript" src="../../public/osmplayer/minplayer/src/minplayer.playLoader.js"></script> 
<script type="text/javascript" src="../../public/osmplayer/minplayer/src/minplayer.players.base.js"></script> 
<script type="text/javascript" src="../../public/osmplayer/minplayer/src/minplayer.players.html5.js"></script> 
<script type="text/javascript" src="../../public/osmplayer/minplayer/src/minplayer.players.flash.js"></script> 
<script type="text/javascript" src="../../public/osmplayer/minplayer/src/minplayer.players.minplayer.js"></script> 
<script type="text/javascript" src="../../public/osmplayer/minplayer/src/minplayer.players.youtube.js"></script> 
<script type="text/javascript" src="../../public/osmplayer/minplayer/src/minplayer.players.vimeo.js"></script> 
<script type="text/javascript" src="../../public/osmplayer/minplayer/src/minplayer.players.limelight.js"></script> 
<script type="text/javascript" src="../../public/osmplayer/minplayer/src/minplayer.controller.js"></script> 
<script type="text/javascript" src="../../public/osmplayer/src/osmplayer.js"></script> 
<script type="text/javascript" src="../../public/osmplayer/src/osmplayer.parser.default.js"></script> 
<script type="text/javascript" src="../../public/osmplayer/src/osmplayer.parser.youtube.js"></script> 
<script type="text/javascript" src="../../public/osmplayer/src/osmplayer.parser.rss.js"></script> 
<script type="text/javascript" src="../../public/osmplayer/src/osmplayer.parser.asx.js"></script> 
<script type="text/javascript" src="../../public/osmplayer/src/osmplayer.parser.xspf.js"></script> 
<script type="text/javascript" src="../../public/osmplayer/src/osmplayer.playlist.js"></script> 
<script type="text/javascript" src="../../public/osmplayer/src/iscroll/src/iscroll.js"></script> 
<script type="text/javascript" src="../../public/osmplayer/src/osmplayer.pager.js"></script> 
<script type="text/javascript" src="../../public/osmplayer/src/osmplayer.teaser.js"></script> 

<!-- Include the Default template CSS and JavaScript. --> 
<link rel="stylesheet" href="../../public/osmplayer/templates/default/css/osmplayer_default.css"> 
<script type="text/javascript" src="../../public/osmplayer/templates/default/js/osmplayer.default.js"></script> 
<script type="text/javascript" src="../../public/osmplayer/templates/default/js/osmplayer.controller.default.js"></script> 
<script type="text/javascript" src="../../public/osmplayer/templates/default/js/osmplayer.pager.default.js"></script> 
<script type="text/javascript" src="../../public/osmplayer/templates/default/js/osmplayer.playLoader.default.js"></script> 
<script type="text/javascript" src="../../public/osmplayer/templates/default/js/osmplayer.playlist.default.js"></script> 
<script type="text/javascript" src="../../public/osmplayer/templates/default/js/osmplayer.teaser.default.js"></script> 

您不必包含所有這些參考。例如,如果您不包含youtube視頻,則可以省略miniplayer.players.youtube.js文件等。希望這可以幫助。

編輯:我的jQuery引用是在一個共同的佈局頁面上,並且總是加載進來。這些都是絕對需要的。只要小心不要參考那些兩次。這也造成了我一個問題。

0

對於任何絆倒這個,或原來的用戶,如果你仍然有同樣的問題,這裏有什麼問題。

此部分就在這裏。

<!-- Include the DarkHive ThemeRolller jQuery UI theme. --> 
<link rel="stylesheet" href="osmplayer/jquery-ui/dark-hive/jquery-ui-1.8.18.custom.css"> 
<!-- Include the Default template CSS and JavaScript. --> 
<link rel="stylesheet" href="osmplayer/templates/default/css/osmplayer_default.css"> 
<link rel="stylesheet" href="osmplayer/templates/default/osmplayer.default.js"> 

如果你看最後一個鏈接,它是osmplayer.default.js不是樣式表。將其切換到

<script type="text/javascript" src="osmplayer/templates/default/osmplayer.default.js"></script>