Viewing Specifying Video Volume

Specifying Video Volume



User: Les C. 10 years ago
I am using an HTML snippet to load and play a video.

Can anyone tell me why this code is not reducing the volume of the video:

<video src="{!-ASSETSPATH-!}External%20Files/Henry%20Home.m4v" autoplay="autoplay"volume="50"></video>


Thanks,

L C
User: James G. 10 years ago
I may be wrong, but those 2 % usually indicate a space that shouldn't be there, try removing them?
User: Les C. 10 years ago
--Jim

Thanks for your reply.

I removed the space and the videos still plays, but the volume does't change.

Any other suggestions?


Thanks,

L C
User: Paul-RAGESW 10 years ago
The video tag does not support a volume attribute.

You can do this with Javascript I believe like so (I have not tested this though). Also see my changes to your video tag.

<script>
function setvolume() {
var vid = document.getElementById("myVideo");
vid.volume = 0.5;
}
window.onload = setvolume;
</script>

<video src="{!-ASSETSPATH-!}External%20Files/Henry%20Home.m4v" autoplay="autoplay id="myVideo"></video>

Last edit 10 years ago

-------------------------------
Paul
EverWeb Developer
User: Les C. 10 years ago
--Paul

Thanks for your reply.

The video plays, but there is still no change in volume.

I also tried setting vidvolume = 0; which should make it completely silent. No change.

Any ideas?


Thanks,

L C
User: James G. 10 years ago
This might help you, also look at the browser support on that page
User: Les C. 10 years ago
The only solution I could find is to reformat the source file.
✔ Best Answer  
User: Jumbo T. 10 years ago
The solution is not changing the video.

The solution is doing it right :

<video src="{!-ASSETSPATH-!}External%20Files/Henry%20Home.m4v" autoplay id="myVideo"></video>
<script>
vid = document.getElementById("myVideo");
vid.volume = 0.2;
</script>

PS. It doesn't work on mobile devices. You have to use the volume button.

Last edit 10 years ago
User: Les C. 10 years ago
--Jumbo

Thanks. That works!


L C


PS EverWebs site doesn't allow me to change your response to "Best Answer." Sorry.

Last edit 10 years ago


Post Reply
You must login or signup to post.