I am trying in several ways to start jwplayer in my web app in which i use angularjs.. I need to pass at file option a dynamic link of the file. In my controller i can have the dynamic link with a simple function
getVideoStreaming: function(file) {
$scope.fileName = file.name;
$scope.documentId = document.id;
$scope.videoSrc = "http://mywebserver.com/" + $scope.fileName;
},
this function is called when i click in a button that opens a modal in which i want show the video.
<button data-uk-modal="{target:'#videoPlayer'}" data-ng-click="files.getVideoStreaming(file)"> Open video </button>
Now the question.. how can i pass this variable to my modal? According to the jwplayer basic configuration this is what i should do:
<!-- 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>
but of course, as i've just said, i need file dynamic. Is it possible find a solution to this?