更新
- 它会出现来自 Rackspace WORKS 的“直接/下载 URL”!
- 但是,与 FloPlayer 一起使用的“流 URL”不适用于 jwPlayer!?
我可以加载图像,我可以从 post ajax 获取 url。除了视频,我无法让一切正常工作。老实说,不知道出了什么问题。
头
<script type="text/javascript" src="js/jquery-1.9.1.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.10.3.custom.min.js"></script>
<script type="text/javascript" src="js/jdPlugs.js"></script> // personal lib (jQuery extendor)
<script type="text/javascript" src="js/jwplayer/jwplayer.js"></script>
<script type="text/javascript">jwplayer.key="";</script>
JS(满)
var rackCDN = "http:// rackspace cloud link .com";
(function($) {
if (!$.jwplayer) {
$.extend({
jwplayer: function(elm, command, args) {
if ($.jwplayer.methods[arguments[0]]) return $.jwplayer.methods[arguments[0]].apply(this, Array.prototype.slice.call(arguments, 1));
if (typeof elm == "string") return jwplayer(elm);
return jwplayer(elm.prop("id"));
}
});
$.jwplayer.methods = {
load: function() { return jwplayer().load([arguments[0]]); },
play: function() { return jwplayer().play(); },
pause: function() { return jwplayer().pause(); }
}
}
})(jQuery);
function liClick() {
var key = $(this).data("key"),
opts = {
file: rackCDN+key,
image: rackCDN+key
};
console.log(opts);
$.jwplayer("load", opts);
}
$(function() {
$.jwplayer("testPlayer01").setup({
file: "http:// rackspace cloud link .com/2013/03/20130303-message-service-hd.mp4",
image: "http:// rackspace cloud link .com/video-stills/large/542.jpg",
provider: "<?php echo(base_url('js/jwplayer/AkamaiAdvancedJWStreamProvider.swf')); ?>",
height: "480",
width: "600"
});
$("li a").on("click", liClick);
$("button").on("click", function(e) {
$.jwplayer($.trim($(this).text()));
});
$("h3").css({ cursor: "pointer" }).on("click", function(e) {
$.getJSON($.myURL("controllers/getList.php"), function(data) {
console.log(data)
if ($.objLength(data) > 0) {
$("ul").empty();
for (x in data) {
$("<li />").append($("<a />", { "data-key": data[x].name, href: "javascript:void(0)", text: data[x].name })).appendTo($("ul"));
}
$("li a").on("click", liClick).first().click();
}
});
})
})
JS(我认为是焦点)
$.jwplayer("testPlayer01").setup({
file: "http:// a working link .mp4",
image: "http:// a working link .jpg",
// link tested, file does reside here
provider: "<?php echo(base_url('js/jwplayer/AkamaiAdvancedJWStreamProvider.swf')); ?>",
height: "480",
width: "600"
});
是的,我有我的标题包含,不,除了 jwerror,代码 4 之外,我没有收到任何控制台错误。
MediaError
code: 4
__proto__: MediaError
MEDIA_ERR_ABORTED: 1
MEDIA_ERR_DECODE: 3
MEDIA_ERR_ENCRYPTED: 5
MEDIA_ERR_NETWORK: 2
MEDIA_ERR_SRC_NOT_SUPPORTED: 4