Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. <video width="640" height="264" muted autoplay webkit-playsinline src="'+videoURL+'"></video>'
  2.  
  3. $(document).on("click",".containerVolume",function(e){
  4. if(isMuted){
  5. $('video').prop('muted', false);
  6. }
  7. else{
  8. $('video').prop('muted',true);
  9. }
  10. });
  11.  
  12. var videos = document.querySelectorAll('video');
  13. if (location.search === '?enabled=false')
  14. {
  15. } else if (location.search === '?enabled=true') {
  16. enableVideos(false);
  17. } else {
  18. enableVideos();
  19. }
  20. function enableVideos(everywhere) {
  21. for (var i = 0; i < videos.length; i++) {
  22. window.makeVideoPlayableInline(videos[i], !videos[i].hasAttribute('muted'), !everywhere);
  23. }
  24. }
  25.  
  26. function toggleMute() {
  27.  
  28. var video=document.getElementById("myVideo");
  29.  
  30. if(video.muted){
  31. video.muted = false;
  32. } else {
  33. video.muted = true;
  34. }
  35.  
  36. }
  37.  
  38. var video=document.getElementById("myVideo") ;
  39.  
  40. $(video).on("click", function(e){
  41. if(video.muted){
  42. video.muted = false;
  43. }
  44. else{
  45. video.muted = true;
  46. }
  47. });
  48.  
  49. document.getElementById("theIdOfYourVideoGoesHere").volume=0.9;
  50.  
  51. <video id="theIdOfYourVideoGoesHere" muted>
  52.  
  53. <video id="theIdOfYourVideoGoesHere">
  54.  
  55. document.getElementById("theIdOfYourVideoGoesHere").muted;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement