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