我是HTML5和JQuery的新手。我遇到了以下媒体播放器:打开HTML5的标准媒体播放器(http://mediafront.org/osmplayer/)。但是当我试图将播放器包含在我的html页面中时,播放器没有运行。可能的原因是什么? PFB用于包含播放器的代码。
<!-- 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 :(得分: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引用位于一个公共布局页面上,并且总是被加载。这些肯定是必需的。请注意不要两次引用它们。这也给我带来了麻烦。
答案 1 :(得分: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>