我正在尝试使用替代安装程序在应用程序中使用Azure Media Player进行简单的POC,以使用此博客文章中的JavaScript动态加载HTML。尝试通过javascript进行加载时,出现了如下所述的错误。
如果我仅包含javascript文件并按照示例“步骤2:将HTML视频标记添加到您的页面”,那么它可以工作:
<video id="azuremediaplayer" class="azuremediaplayer amp-default-skin amp-big-play-centered" controls autoplay width="640" height="400" poster="" data-setup='{"nativeControlsForTouch": false}' tabindex="0">
<source src="http://amssamples.streaming.mediaservices.windows.net/91492735-c523-432b-ba01-faba6c2206a2/AzureMediaServicesPromo.ism/manifest" type="application/vnd.ms-sstr+xml" />
<p class="amp-no-js">To view this video please enable JavaScript, and consider upgrading to a web browser that supports HTML5 video</p>
</video>
但是我尝试按照“使用JavaScript动态加载HTML的替代设置”中所述通过javascript动态加载它,但出现错误
Uncaught Error: Error: TypeError: URL.createObjectURL is not a function azuremediaplayer.min.js:2
我正在尝试的内容:为了使事情变得简单,我只是想让它加载视频以响应按钮单击。我有此代码,这只是所提供示例的直接副本。
HTML:
<video id="azuremediaplayer" class="azuremediaplayer amp-default-skin amp-big-play-centered">
</video>
<button id="amsbutton" type="button">Load</button>
Javascript:
$("#amsbutton").on("click", function () {
AMSVideo();
});
function AMSVideo() {
var myOptions = {
"nativeControlsForTouch": false,
autoplay: true,
controls: true,
width: "640",
height: "400",
poster: ""
};
var myPlayer = amp("azuremediaplayer", myOptions);
myPlayer.src([
{ src: "http://amssamples.streaming.mediaservices.windows.net/91492735-c523-432b-ba01-faba6c2206a2/AzureMediaServicesPromo.ism/manifest", type: "application/vnd.ms-sstr+xml" },
]);
}
我从来没有确切地发现冲突是什么,但是事实证明这与CKEDITOR 4.3.1不兼容。当我注释掉我的ckeditor代码时:
CKEDITOR.replace('text-content', {
toolbar: 'Basic',
uiColor: '#9AB8F3',
});
问题消失了。幸运的是,无论它在ckeditor的更高版本中都得到了解决。我从他们的CDN中放了ckeditor //cdn.ckeditor.com/4.4.7/standard/ckeditor.js"
,问题似乎消失了。由于这指向ckeditor的“标准”版本,因此如果它像特定的ckeditor插件那样更加具体,我将对其进行更新。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句