-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds support for multiple players on same view
- Loading branch information
David Karchmer
committed
Nov 28, 2015
1 parent
81fa86a
commit 260c2a8
Showing
8 changed files
with
157 additions
and
63 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ bower_components/ | |
.sass-cache/ | ||
.idea/ | ||
.tmp/ | ||
index-test.html |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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> |
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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