我必须在弹出窗口中显示jwplayer,对于使用ngDialog (角)的弹出窗口,ngDialog的代码如下:
$scope.showVideoPlayerPopup = function(video_path)
{
$scope.ngDialog = ngDialog;
ngDialog.open({
animation: true,
scope:$scope,
template:'<div id="video_popup"></div>',
plain: true,
//className: 'ngdialog-theme-default',
closeByDocument: true
//backdrop : 'static'
});
playVideo(video_path);
}上面调用的play视频函数包含jwplayer的代码,如下所示:
<script>
function playVideo(video_path)
{
jwplayer("video_popup").setup({
file: video_path,
width: "600px",
height: "600px",
stretching: "bestfit",
});
}
</script>当我对简单的html代码使用相同的jwplayer代码(没有弹出)时,它工作得很好,但是我尝试将我的html放在弹出窗口中,它给了我下面的错误:
错误:jwplayer(.).setup不是函数
更新
我的档案包括:
<script src="https://content.jwplatform.com/libraries/qAkRysIB.js"></script>发布于 2016-10-17 05:48:08
1. From your [Player Downloads & Keys](https://dashboard.jwplayer.com/#/players/downloads) page, scroll down to the **Cloud Hosted Player Libraries** section.2. In the **Cloud Hosted Player Libraries** section, select a **Player Title** from the dropdown menu.3. Copy the **Cloud Player Library Url**.4. Within the `<head>` of your page, copy and paste the URL to the player library.setup函数之前,确保面板已加载。实现此目的的一种方法是从ngDialog.opened注册ngDialog事件侦听器(参见ngDialog自述的事件部分):
$scope.$on(‘ngDialog.open’,函数(e,$dialog) { playVideo();});发布于 2016-10-17 05:40:58
在jwplayer(.) Yes...because脚本可以work...May之前,必须在DOM中使用id "current_video_path“的div标记。您可以使用$timeout或setTimeout添加一些延迟,这样它就有足够的时间在弹出窗口中呈现div,然后才能使用该脚本。
https://stackoverflow.com/questions/40078984
复制相似问题