From 2b252c6b1899e17c96db612658ca41eb1bb6570e Mon Sep 17 00:00:00 2001 From: Adabriand Furtado Date: Sun, 7 Aug 2016 22:05:17 -0300 Subject: [PATCH] Adicionado suporte ao Safari. --- view/js/helpers/video-helper.js | 31 +++++++++++++++++++++++++++++++ view/js/validador.js | 8 ++++---- view/templates/index.html | 7 +++---- 3 files changed, 38 insertions(+), 8 deletions(-) create mode 100644 view/js/helpers/video-helper.js diff --git a/view/js/helpers/video-helper.js b/view/js/helpers/video-helper.js new file mode 100644 index 0000000..d280023 --- /dev/null +++ b/view/js/helpers/video-helper.js @@ -0,0 +1,31 @@ +(function(videoHelper, $, undefined) { + + function _getSource(videoBaseUrl) { + return '' + + 'Sem suporte a vĂ­deos'; + } + + function _controlVideo(elId, toPlay) { + if ($(elId).length === 0) + return; + if (toPlay) { + $(elId).get(0).play(); + } else { + $(elId).get(0).pause(); + } + } + + videoHelper.play = function(elId) { + _controlVideo(elId, true); + }; + + videoHelper.pause = function(elId) { + _controlVideo(elId, false); + }; + + videoHelper.getSource = function(videoBaseUrl) { + return _getSource(videoBaseUrl); + }; + +}(window.videoHelper = window.videoHelper || {}, jQuery)); diff --git a/view/js/validador.js b/view/js/validador.js index bf12e50..3b4e3be 100755 --- a/view/js/validador.js +++ b/view/js/validador.js @@ -219,11 +219,11 @@ function _loadTaskInfo(task) { currentTaskId = task.id; var signName = task.info.sign_name; - var avatarVidLink = videosUrl + signName + '_AVATAR.webm'; - var refVidLink = videosUrl + signName + '_REF.webm'; + var baseAvatarVidUrl = videosUrl + signName + '_AVATAR'; + var baseRefVidUrl = videosUrl + signName + '_REF'; $('.sign-label').text(signName); - $('#avatar-video').attr('src', avatarVidLink); - $('#ref-video').attr('src', refVidLink); + $('#avatar-video').html(videoHelper.getSource(baseAvatarVidUrl)); + $('#ref-video').html(videoHelper.getSource(baseRefVidUrl)); } function _loadMainComponents() { diff --git a/view/templates/index.html b/view/templates/index.html index 9436abf..5ab30c2 100755 --- a/view/templates/index.html +++ b/view/templates/index.html @@ -3,6 +3,7 @@ + @@ -47,9 +48,8 @@
-
@@ -77,9 +77,8 @@
-
-- libgit2 0.21.2