Update to video 1.2 api
parent
d6ecc1705a
commit
061c15a2d6
|
@ -293,21 +293,23 @@ H5P.QuestionSet = function (options, contentId) {
|
||||||
var $videoContainer = $('<div class="video-container"></div>').appendTo($myDom);
|
var $videoContainer = $('<div class="video-container"></div>').appendTo($myDom);
|
||||||
|
|
||||||
var video = new H5P.Video({
|
var video = new H5P.Video({
|
||||||
files: videoData,
|
sources: videoData,
|
||||||
fitToWrapper: true,
|
fitToWrapper: true,
|
||||||
controls: false,
|
controls: false,
|
||||||
autoplay: false
|
autoplay: false
|
||||||
}, contentId);
|
}, contentId);
|
||||||
video.endedCallback = function () {
|
video.on('stateChange', function (event) {
|
||||||
displayResults();
|
if (event.data === H5P.Video.ENDED) {
|
||||||
$videoContainer.hide();
|
displayResults();
|
||||||
};
|
$videoContainer.hide();
|
||||||
|
}
|
||||||
|
});
|
||||||
video.attach($videoContainer);
|
video.attach($videoContainer);
|
||||||
video.play();
|
video.play();
|
||||||
|
|
||||||
if (params.endGame.skipButtonText) {
|
if (params.endGame.skipButtonText) {
|
||||||
$('<a class="h5p-button skip">' + params.endGame.skipButtonText + '</a>').click(function () {
|
$('<a class="h5p-button skip">' + params.endGame.skipButtonText + '</a>').click(function () {
|
||||||
video.stop();
|
video.pause();
|
||||||
$videoContainer.hide();
|
$videoContainer.hide();
|
||||||
displayResults();
|
displayResults();
|
||||||
}).appendTo($videoContainer);
|
}).appendTo($videoContainer);
|
||||||
|
|
Loading…
Reference in New Issue