Created
January 20, 2017 14:06
-
-
Save efogdev/c87c682ef4b93f03d6a01ba91cbfbac0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ($scope, element) { | |
var options = $scope.options || {}; | |
$scope.playing = false; | |
var thumbnailUrl = $scope.thumbnailUrl = options.img || '', | |
videoUrl = options.videoUrl || '', | |
title = $scope.title = options.mediaTitle || 'Unknown Title', | |
description = options.description || '', | |
id = options.id || -1, | |
rating = $scope.rating = options.rating || 0; | |
$scope.showPlayer = function () { | |
$rdPlayer.clear(); | |
var playerElement = $('<div></div>') | |
.addClass('rd-player') | |
.attr('id', 'player' + id); | |
element.find('.jw-player-instance').append(playerElement); | |
$scope.player = jwplayer(playerElement[0]); | |
$scope.player.setup({ | |
file: videoUrl, | |
image: thumbnailUrl, | |
width: '100%', | |
height: '100%', | |
title: title, | |
description: description, | |
mediaid: id | |
}); | |
$scope.playing = true; | |
}; | |
$scope.play = function () { | |
$scope.player.play(); | |
}; | |
$scope.fullscreen = function () { | |
$scope.player.setFullscreen(true); | |
}; | |
}]) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment