-
Notifications
You must be signed in to change notification settings - Fork 32
/
index.html
executable file
·74 lines (61 loc) · 2.31 KB
/
index.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
67
68
69
70
71
72
73
74
<!DOCTYPE html>
<html ng-app="angularVideoBg">
<head>
<title></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="utf-8">
<link href="app.less" type="text/css" rel="stylesheet/less">
</head>
<body>
<!-- Livereload script for development only (stripped during dist build) -->
<script src="http://localhost:35729/livereload.js" data-concat="false"></script>
<!-- JS from Bower Components -->
<script src="bower_components/angular/angular.js"></script>
<!-- Add New Bower Component JS Above -->
<!-- Main App JS -->
<script src="angular-video-bg.js"></script>
<!-- Add New Component JS Above -->
<script type="text/javascript">
angular.module('angularVideoBg').controller('VideoCtrl', ['$scope', '$timeout', function($scope) {
$scope.videoId = 'nfWlot6h_JM';
$scope.videos = [{
videoId: 'nfWlot6h_JM',
start: 30,
end: 40
}];
$scope.callback = function(player) {
$scope.pauseVideo = function() {
player.pauseVideo();
};
$scope.playVideo = function() {
player.playVideo();
};
};
$scope.changeVideo = function() {
$scope.videoId = 'Xa0Q0J5tOP0';
$scope.videos.push({
videoId: 'Xa0Q0J5tOP0',
start: 30,
end: 40
});
};
$scope.destroyVideo = function() {
$scope.videoDestroyed = !$scope.videoDestroyed;
};
}]);
</script>
<div ng-controller="VideoCtrl">
<video-bg ng-if="!videoDestroyed" playlist="videos" player-callback="callback(player)"></video-bg>
<p style="padding: 200px 0;">Testing transclude!</p>
<button type="button" ng-click="changeVideo()">Change Video</button>
<button type="button" ng-click="pauseVideo()" ng-show="pauseVideo">Pause Video</button>
<button type="button" ng-click="playVideo()" ng-show="playVideo">Play Video</button>
<button type="button" ng-click="destroyVideo()" ng-show="destroyVideo">Destroy Video</button>
</div>
<div>
<video-bg video-id="'cqcldOyEYRE'">
<p style="padding: 200px 0;">Testing transclude 2!</p>
</video-bg>
</div>
</body>
</html>