2
我想用幾種方法在我的web應用程序中啓動jwplayer,其中我使用angularjs ..我需要通過file
選項文件的動態鏈接。在我的控制,我可以有一個簡單的功能Jwplayer with angularjs
getVideoStreaming: function(file) {
$scope.fileName = file.name;
$scope.documentId = document.id;
$scope.videoSrc = "http://mywebserver.com/" + $scope.fileName;
},
當我打開的,我想顯示視頻模態按鈕點擊這個函數被調用動態鏈接。
<button data-uk-modal="{target:'#videoPlayer'}" data-ng-click="files.getVideoStreaming(file)"> Open video </button>
現在的問題..我怎麼能把這個變量傳遞給我的模態?根據該jwplayer基本配置這是我應該做的:
<!-- dialog video -->
<div id="videoPlayer" class="uk-modal">
<div class="uk-modal-dialog" style="width: 680px!important;">
<a class="uk-modal-close uk-close"></a>
<h3 class="uk-panel-title">
<i class="zmdi zmdi-collection-text"></i>
{{docName}}
</h3>
<div id="myElement">Loading the player...</div>
<script type="text/javascript">
var playerInstance = jwplayer("myElement");
playerInstance.setup({
file: "http://example.com/uploads/file.mp4",
image: "http://example.com/uploads/myPoster.jpg",
width: 640,
height: 360,
title: 'Basic Video Embed',
description: 'A video with a basic title and description!'
});
</script>
</div>
</div>
但當然,正如我剛纔所說,我需要file
動態。有沒有可能找到解決辦法?