Browse Source

Prevent clicks on subscriber video.

pull/83/head
Joachim Bauch 11 years ago
parent
commit
8551f464b0
  1. 9
      src/styles/components/_youtubevideo.scss
  2. 14
      static/js/directives/youtubevideo.js
  3. 2
      static/partials/youtubevideo.html

9
src/styles/components/_youtubevideo.scss

@ -64,6 +64,15 @@
font-size: 2em; font-size: 2em;
} }
.youtubevideo .click-container {
position: absolute;
left: 0;
top: 0;
bottom: 0;
right: 0;
z-index: 5;
}
.youtubevideo .welcome { .youtubevideo .welcome {
max-width: 700px; max-width: 700px;
} }

14
static/js/directives/youtubevideo.js

@ -33,7 +33,6 @@ define(['jquery', 'underscore', 'text!partials/youtubevideo.html', 'bigscreen'],
var addedIframeScript = false; var addedIframeScript = false;
var player = null; var player = null;
var playerReady = null; var playerReady = null;
var isPublisher = null;
var isPaused = null; var isPaused = null;
var seekDetector = null; var seekDetector = null;
var playReceivedNow = null; var playReceivedNow = null;
@ -57,6 +56,7 @@ define(['jquery', 'underscore', 'text!partials/youtubevideo.html', 'bigscreen'],
"150": "notAllowedEmbedded" "150": "notAllowedEmbedded"
}; };
$scope.isPublisher = null;
$scope.playbackActive = false; $scope.playbackActive = false;
$scope.hideControlsBar = true; $scope.hideControlsBar = true;
$scope.currentVideoUrl = null; $scope.currentVideoUrl = null;
@ -186,7 +186,7 @@ define(['jquery', 'underscore', 'text!partials/youtubevideo.html', 'bigscreen'],
$scope.$on("youtube.paused", function() { $scope.$on("youtube.paused", function() {
stopDetectSeek(); stopDetectSeek();
if (!isPublisher || !currentToken) { if (!$scope.isPublisher || !currentToken) {
return; return;
} }
@ -208,7 +208,7 @@ define(['jquery', 'underscore', 'text!partials/youtubevideo.html', 'bigscreen'],
}); });
$scope.$on("youtube.seeked", function($event, position) { $scope.$on("youtube.seeked", function($event, position) {
if (!isPublisher || !currentToken) { if (!$scope.isPublisher || !currentToken) {
return; return;
} }
@ -248,7 +248,7 @@ define(['jquery', 'underscore', 'text!partials/youtubevideo.html', 'bigscreen'],
}; };
var createVideoPlayer = function(with_controls) { var createVideoPlayer = function(with_controls) {
if (player && isPublisher !== with_controls) { if (player && $scope.isPublisher !== with_controls) {
player.destroy(); player.destroy();
player = null; player = null;
playerReady = null; playerReady = null;
@ -280,7 +280,7 @@ define(['jquery', 'underscore', 'text!partials/youtubevideo.html', 'bigscreen'],
"onStateChange": onPlayerStateChange "onStateChange": onPlayerStateChange
} }
}); });
isPublisher = with_controls; $scope.isPublisher = with_controls;
} }
}); });
}; };
@ -415,7 +415,7 @@ define(['jquery', 'underscore', 'text!partials/youtubevideo.html', 'bigscreen'],
Type: "Show", Type: "Show",
Show: true Show: true
}); });
if (isPublisher && $scope.currentVideoUrl) { if ($scope.isPublisher && $scope.currentVideoUrl) {
var playInfo = { var playInfo = {
url: $scope.currentVideoUrl, url: $scope.currentVideoUrl,
id: $scope.currentVideoId id: $scope.currentVideoId
@ -496,7 +496,7 @@ define(['jquery', 'underscore', 'text!partials/youtubevideo.html', 'bigscreen'],
player.destroy(); player.destroy();
player = null; player = null;
} }
isPublisher = null; $scope.isPublisher = null;
$scope.playbackActive = false; $scope.playbackActive = false;
$scope.currentVideoUrl = null; $scope.currentVideoUrl = null;
$scope.currentVideoId = null; $scope.currentVideoId = null;

2
static/partials/youtubevideo.html

@ -28,6 +28,8 @@
<div id="youtubeplayerinfo"> <div id="youtubeplayerinfo">
<div>{{_('Currently playing')}}<br>{{ currentVideoUrl }}</div> <div>{{_('Currently playing')}}<br>{{ currentVideoUrl }}</div>
</div> </div>
<div class="click-container" ng-show="!isPublisher">
</div>
</div> </div>
</div> </div>
</form> </form>

Loading…
Cancel
Save