Enables and disables controls.

  1. <!-- Set up a player with the ID attribute set to "myPlayer" -->
  2. <div id="myPlayer" data-wimpyplayer></div>
  3.  
  4.  
  5. <script>
  6.  
  7. /*
  8. // Quick Reference:
  9. // enableControls(); // enables all "main play controls" as defined in wimpyConfigs.mainPlayControls.
  10. // enableControls(1); // enables all "main play controls" as defined in wimpyConfigs.mainPlayControls.
  11. // enableControls(0); // DISABLES all "main play controls" as defined in wimpyConfigs.mainPlayControls.
  12. // enableControls(1, "foo,bar"); // enables only the controls defined in list
  13. // enableControls(0, "foo,bar"); // disables only controls defined in list
  14. */
  15.  
  16. <!-- A little relay function (so our HTML isn't impossible to read). -->
  17. function disabler(param){
  18. // Get a handle to the player by requesting a player from wimpy
  19. // with the "getPlayer" method. We set the argument to the ID
  20. // we used when settign up the player in the DIV above.
  21. var plr = wimpy.getPlayer("myPlayer");
  22. // Now send the arguments along to the "enableControls" method in our player.
  23. plr.disableControls(param);
  24. }
  25.  
  26. // Same as above, but calling "diableControls" instead.
  27. function enabler(param){
  28. var plr = wimpy.getPlayer("myPlayer");
  29. plr.enableControls(param);
  30. }
  31.  
  32. </script>
  33.  
  34.  
  35. <p><input type="button" onclick="disabler()" value="DISABLE All Play Controls"></p>
  36.  
  37. <p><input type="button" onclick="enabler()" value="Enable All Play Controls"></p>
  38.  
  39. <p><input type="button" onclick="disabler('play,next,scrubber')" value="DISABLE Play, Next, Scrubber (timeline)"></p>
  40.  
  41. <p><input type="button" onclick="enabler('play,next,scrubber')" value="Enable Play, Next, Scrubber (timeline)"></p>