Have an idea?

Visit Sawtooth Software Feedback to share your ideas on how we can improve our products.

How to validate video controls ?

How to hide the video controls like play ,pause forward buttons in the survey .The respondent should watch the video completely .
asked Oct 13, 2015 by sandeepkapalawai Bronze (1,475 points)
retagged Oct 13, 2015 by Walter Williams

2 Answers

0 votes
 
Best answer
header2 tag:

<video id="vd" controls="">
    <source src="[% GraphicsPath() %]vd2.mp4"></source>
</video>

footer:

<script type="text/javascript">

document.getElementById("vd").controls = false;
$(document).ready(function() {
  var playing = false;
  
  $("#vd").click(function() {
      $(this).toggleClass("down");

      if (playing == false) {
          document.getElementById('vd').play();
          playing = true;
        } else {
        document.getElementById('vd').pause();
        playing = false;
      }

  });
  //disable right click

  $("#vd").on("contextmenu",function()
        {
               return false;
        });
  });
</script>


Or you can simply use this:

$("#vd")[0].play();
$('vd').click(function() { $(this).get(0).paused ? $(/this).get(0).play() : $(this).get(0).pause(); });
answered Oct 29, 2015 by Harika Mandula Bronze (580 points)
selected Feb 8, 2016 by sandeepkapalawai
0 votes
If you are using a video platform like Youtube, there are some options to make this easy here:
https://www.youtube.com/watch?v=f8_FsBQUW_k

If you are hosting the video yourself and using some kind of HTML5 player, you'll have to use the instructions provided by that player.

One good example is http://jplayer.org/

It's flexible, and you can hide the player's buttons with CSS styling.
answered Oct 19, 2015 by Jonathan Huff Bronze (1,575 points)
...