0

我是 HTML5 和 JQuery 的新手。我遇到了以下媒体播放器:Open Standard Media player for 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">
4

2 回答 2

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>
于 2013-08-19T04:44:07.170 回答
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 引用在一个通用布局页面上,并且总是被加载。这些是绝对需要的。请注意不要两次引用这些内容。这也给我带来了一个问题。

于 2013-04-15T20:55:10.403 回答