-
Notifications
You must be signed in to change notification settings - Fork 6
/
index2.html
66 lines (49 loc) · 2.2 KB
/
index2.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<html lang="en" ng-app="myApp">
<head>
<meta charset="utf-8">
<title>angular-jwplayer</title>
</head>
<body>
<div ng-view>
<div class="container">
<div ng-controller="mainController">
<h1>{{ name1 }}</h1>
<jwplayer ng-src="{{ file1 }}"
player-options="options1"
player-id="myPlayer1">
</jwplayer>
<h1>{{ name2 }}</h1>
<jwplayer ng-src="{{ file2 }}"
player-options="options2"
player-id="myPlayer2">
</jwplayer>
</div>
</div>
</div>
<script type="text/javascript" src="bower_components/angular/angular.js"></script>
<!-- Remplace xxxxxxxxx with your license code given by JWPLayer -->
<script src="https://content.jwplatform.com/libraries/xxxxxxxxxxxx.js"></script>
<script type="text/javascript" src="jwplayer.min.js"></script>
<script>
var myApp = angular.module('myApp', ['ng-jwplayer']);
myApp.controller('mainController', ['$scope', '$log', '$sce', 'jwplayerService',
function ($scope, $log, $sce, jwplayerService) {
$scope.name1 = 'JWPlayer Player 1';
$scope.options1 = {
type: 'mp4'
};
$scope.file1 = $sce.trustAsResourceUrl('http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4');
$scope.name2 = 'JWPlayer Player 2';
$scope.options2 = {
type: 'mp4'
};
$scope.file2 = $sce.trustAsResourceUrl('http://techslides.com/demos/sample-videos/small.mp4');
$scope.$on('ng-jwplayer-ready', function(event, args) {
$log.info('Player ' + args.playerId + ' ready. Playing video');
var player = jwplayerService.myPlayer[args.playerId];
player.play(true);
});
}]);
</script>
</body>
</html>