diff --git a/app/assets/javascripts/v_libras/requests/new.js b/app/assets/javascripts/v_libras/requests/new.js index d281665..de53455 100644 --- a/app/assets/javascripts/v_libras/requests/new.js +++ b/app/assets/javascripts/v_libras/requests/new.js @@ -25,18 +25,18 @@ $(function () { var totalSteps = $("#vlibras-wizard .content section").size(); if ((priorIndex === 0) && (currentIndex === 1)) { - $("#video-step").find("video")[0].pause(); - $("#service-step").find("video")[0].play(); + videojs($("#video-step").find("video")[0]).pause(); + videojs($("#service-step").find("video")[0]).play(); } if ((priorIndex === 1) && (currentIndex === 2)) { - $("#service-step").find("video")[0].pause(); - $("#position-step").find("video")[0].play(); + videojs($("#service-step").find("video")[0]).pause(); + videojs($("#position-step").find("video")[0]).play(); } if ((priorIndex === 2) && (currentIndex === 3)) { - $("#position-step").find("video")[0].pause(); - $("#size-step").find("video")[0].play(); + videojs($("#position-step").find("video")[0]).pause(); + videojs($("#size-step").find("video")[0]).play(); } if ((currentIndex + 1) === totalSteps) { diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 6be8ba8..a6a3443 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -50,17 +50,24 @@ module ApplicationHelper options = args.first || {} options[:id] = id - options[:class] = "video-js vjs-default skin #{classes}" + options[:class] = "video-js vjs-default-skin vjs-big-play-centered #{classes}" content_tag(:video, options) do if url.class == String - content_tag(:source, '', :src => (url + "?t=" + Time.now.getutc.to_i.to_s)) + content_tag(:source, '', :src => (url + "?t=" + Time.now.getutc.to_i.to_s), :type => mimetype_from_url(v)) else url.each do |v| - concat content_tag(:source, '', :src => (v + "?t=" + Time.now.getutc.to_i.to_s)) + concat content_tag(:source, '', :src => (v + "?t=" + Time.now.getutc.to_i.to_s), :type => mimetype_from_url(v)) end end end end + def mimetype_from_url(url) + return 'video/mp4' if url.split('.').last == 'mp4' + return 'video/webm' if url.split('.').last == 'webm' + + 'video/mp4' + end + end diff --git a/app/views/v_libras/requests/_position_step.haml b/app/views/v_libras/requests/_position_step.haml index ef53f7d..fa38964 100644 --- a/app/views/v_libras/requests/_position_step.haml +++ b/app/views/v_libras/requests/_position_step.haml @@ -21,4 +21,6 @@ var VLibrasPosition = new VLibrasLocalization(); VLibrasPosition.init("#position-step", optionsPosition); + + videojs("id-4", { "controls": false, "autoplay": false, "preload": "true", "width": 940, "height": 530 }); }); \ No newline at end of file diff --git a/app/views/v_libras/requests/_service_step.haml b/app/views/v_libras/requests/_service_step.haml index dd63488..2d9b43d 100644 --- a/app/views/v_libras/requests/_service_step.haml +++ b/app/views/v_libras/requests/_service_step.haml @@ -25,5 +25,7 @@ var VLibrasSubAudio = new VLibrasLocalization(); VLibrasSubAudio.init("#service-step", optionsService); + + videojs("id-2", { "controls": false, "autoplay": false, "preload": "true", "width": 940, "height": 530 }); }); diff --git a/app/views/v_libras/requests/_size_step.haml b/app/views/v_libras/requests/_size_step.haml index fd2bdcb..cc598b3 100644 --- a/app/views/v_libras/requests/_size_step.haml +++ b/app/views/v_libras/requests/_size_step.haml @@ -20,5 +20,7 @@ var VLibrasSize = new VLibrasLocalization(); VLibrasSize.init("#size-step", optionsSize); + + videojs("id-3", { "controls": false, "autoplay": false, "preload": "true", "width": 940, "height": 530 }); }); diff --git a/app/views/v_libras/requests/_video_step.haml b/app/views/v_libras/requests/_video_step.haml index 38c0830..7f9ec7c 100644 --- a/app/views/v_libras/requests/_video_step.haml +++ b/app/views/v_libras/requests/_video_step.haml @@ -1,6 +1,4 @@ #video-step.wrapper - .video_wrapper - = html5_video_tag(['/system/videos/workflow/sub_audio.webm', '/system/videos/workflow/sub_audio.mp4'], 'id-1', 'video-wizard') .row-fluid @@ -22,5 +20,5 @@ var VLibrasVideo = new VLibrasLocalization(); VLibrasVideo.init("#video-step", optionsVideo); - VLibrasVideo.play(); + videojs("id-1", { "controls": false, "autoplay": true, "preload": "true", "width": 940, "height": 530 }); }) \ No newline at end of file -- libgit2 0.21.2