Browse Source

Retry loading sandbox through button click.

pull/207/head
Joachim Bauch 10 years ago
parent
commit
4c61ad22a4
  1. 10
      static/js/directives/youtubevideo.js

10
static/js/directives/youtubevideo.js

@ -106,7 +106,11 @@ define(['require', 'jquery', 'underscore', 'moment', 'text!partials/youtubevideo
var initialState = null; var initialState = null;
var sandboxApi = null; var sandboxApi = null;
var createSandboxApi = function() { var createSandboxApi = function(force) {
if (sandboxApi && force) {
sandboxApi.destroy();
sandboxApi = null;
}
if (!sandboxApi) { if (!sandboxApi) {
var sandboxFrame = $("#youtubeplayer", $element)[0]; var sandboxFrame = $("#youtubeplayer", $element)[0];
@ -515,6 +519,10 @@ define(['require', 'jquery', 'underscore', 'moment', 'text!partials/youtubevideo
} }
}; };
$scope.loadYouTubeAPI = function() {
createSandboxApi(true);
};
$scope.showYouTubeVideo = function() { $scope.showYouTubeVideo = function() {
createSandboxApi(); createSandboxApi();
$scope.layout.youtubevideo = true; $scope.layout.youtubevideo = true;

Loading…
Cancel
Save