Commit 45f0581b3970f772d78a625352c7e70a7bdc9c42
1 parent
0fec191e
Exists in
master
Ajuste no tamanho da tela do vídeo de referência.
Showing
2 changed files
with
33 additions
and
8 deletions
Show diff stats
view/assets/css/main.css
@@ -498,6 +498,11 @@ ul.rig.columns-4 li { | @@ -498,6 +498,11 @@ ul.rig.columns-4 li { | ||
498 | margin: auto; | 498 | margin: auto; |
499 | } | 499 | } |
500 | 500 | ||
501 | +#render-ref video { | ||
502 | + background-color: #000000; | ||
503 | + height: 407px; | ||
504 | +} | ||
505 | + | ||
501 | #approval-msg { | 506 | #approval-msg { |
502 | display: none; | 507 | display: none; |
503 | margin: 0px; | 508 | margin: 0px; |
view/assets/js/wikilibras.js
@@ -325,35 +325,55 @@ | @@ -325,35 +325,55 @@ | ||
325 | $("#render-avatar").fadeIn(300); | 325 | $("#render-avatar").fadeIn(300); |
326 | } | 326 | } |
327 | 327 | ||
328 | + function _controlVideo(elId, toPlay) { | ||
329 | + var videoSrc = $(elId).attr("src"); | ||
330 | + if (typeof videoSrc == "undefined" || | ||
331 | + (typeof videoSrc != "undefined" && videoSrc === "")) | ||
332 | + return; | ||
333 | + if (toPlay) { | ||
334 | + $(elId).get(0).play(); | ||
335 | + } else { | ||
336 | + $(elId).get(0).pause(); | ||
337 | + } | ||
338 | + } | ||
339 | + | ||
340 | + function _playVideo(elId) { | ||
341 | + _controlVideo(elId, true); | ||
342 | + } | ||
343 | + | ||
344 | + function _pauseVideo(elId) { | ||
345 | + _controlVideo(elId, false); | ||
346 | + } | ||
347 | + | ||
328 | function _showInitialScreen(toShow) { | 348 | function _showInitialScreen(toShow) { |
329 | if (toShow) { | 349 | if (toShow) { |
330 | $("#initial-screen").fadeIn(300); | 350 | $("#initial-screen").fadeIn(300); |
331 | - $("#initial-screen video").get(0).play(); | 351 | + _playVideo("#initial-screen video"); |
332 | } else { | 352 | } else { |
333 | $("#initial-screen").hide(); | 353 | $("#initial-screen").hide(); |
334 | - $("#initial-screen video").get(0).pause(); | 354 | + _pauseVideo("#initial-screen video"); |
335 | } | 355 | } |
336 | } | 356 | } |
337 | 357 | ||
338 | function _showConfigurationScreen(toShow) { | 358 | function _showConfigurationScreen(toShow) { |
339 | if (toShow) { | 359 | if (toShow) { |
340 | $("#configuration-screen").show(); | 360 | $("#configuration-screen").show(); |
341 | - $("#ref-video-container video").get(0).play(); | 361 | + _playVideo("#ref-video-container video"); |
342 | } else { | 362 | } else { |
343 | $("#configuration-screen").hide(); | 363 | $("#configuration-screen").hide(); |
344 | - $("#ref-video-container video").get(0).pause(); | 364 | + _pauseVideo("#ref-video-container video"); |
345 | } | 365 | } |
346 | } | 366 | } |
347 | 367 | ||
348 | function _showRenderScreen(toShow) { | 368 | function _showRenderScreen(toShow) { |
349 | if (toShow) { | 369 | if (toShow) { |
350 | $("#render-screen").fadeIn(300); | 370 | $("#render-screen").fadeIn(300); |
351 | - $("#render-ref video").get(0).play(); | ||
352 | - $("#render-avatar video").get(0).play(); | 371 | + _playVideo("#render-ref video"); |
372 | + _playVideo("#render-avatar video"); | ||
353 | } else { | 373 | } else { |
354 | $("#render-screen").hide(); | 374 | $("#render-screen").hide(); |
355 | - $("#render-ref video").get(0).pause(); | ||
356 | - $("#render-avatar video").get(0).pause(); | 375 | + _pauseVideo("#render-ref video"); |
376 | + _pauseVideo("#render-avatar video"); | ||
357 | } | 377 | } |
358 | } | 378 | } |
359 | 379 |