The volume control in HTML5 videos on my website is not appearing, see screenshot: The video plays when started, but without any sound. The videos also play fine (with sound) in VLC and Windows Media Player.
I have tested in Chrome (65.0.3325.162), Firefox (59.0.1), and Android (on a Samsung tablet). The volume of my system is fine with other applications, and YouTube videos.
Here is the (minimal) code (adding additional attributes like height and poster etc. makes no difference to the problem):
<!DOCTYPE html>
<html lang='en'>
<body>
<video controls src='vid1.mp4' width='500'>
</video>
<video controls width='500'>
<source src='vid2.mp4' type='video/mp4' />
</video>
</body>
</html>
Am I missing something obvious?
[1]: https://i.stack.imgur.com/qAl7D.png
EDIT:
When I tested with a sample video on http://techslides.com/demos/sample-videos/small.mp4 the controls appeared. It seems to have something to do with the encoded mp4 video itself.
I have now removed the video urls. I re-encoded the videos using VLC, and they are now working correctly.
Why are these HTML5 video problems cropping up now after 5+ years?
TLDR: Your code routes around video content farms and their ad-click revenue by short circuiting MP4 content and eyeballs per second, this is retaliation. It's par for the course.
Browser developers have busted your HTML5 <video> browser embed code, either on purpose or by accident around the codecs needed to decode them. They own the source code of the browser that interprets and decodes your HTML5 MP4 file for presentation in the browser content area. Chrome developers corner the market on MP4 Videos and had their arms twisted by the powers that be. So the browser sees that the codec required to decode your MP4 is likely from an unauthorized area, and thus here we are scratching our heads as to why chrome isn't showing a volume button.
My requirements has to be that HTML5 Video is fixed on server side, I can't require users to fiddle around with their chrome flags or installing a plugin that corrects the bug. It has to just work by default on the latest Chrome, Safari, Firefox then IE, preferably in that order.
Screenshot of the case of the missing HTML5 video volume button:
The video plays, but at zero volume. No volume button is ever presented either during initial load, nor during or after playback. The mp4 download and go-full screen buttons are presented and work correctly during playback.
And yes, the chrome flags for new media player are disabled:
What it looked like before, what I expect to see:
The stripped down code I'm using:
This code was evolved from the likes of: http://camendesign.com/code/video_for_everybody
<html><body>
<video width="640"
preload="none"
height="360"
poster="some_content.png"
controls="controls">
<source src="some_content.mp4"
<source src="__VIDEO__.webm" type="video/webm" />
<source src="__VIDEO__.ogv" type="video/ogg" /><!--[if gt IE 6]>
<object width="640" height="375" classid="clsid:02BF25D5-8C17-4B23-BC80-D348
[endif]--><!--[if !IE]><!-->
<object width="640" height="375" type="video/quicktime" data="__VIDEO__.mp4"
<param name="src" value="__VIDEO__.mp4" />
<param name="autoplay" value="false" />
<param name="showlogo" value="false" />
<object width="640" height="380" type="application/x-shockwave-flash"
data="__FLASH__.swf?image=__POSTER__.jpg&file=__VIDEO__.mp4">
<param name="movie" value="__FLASH__.swf?image=__POSTER__.jpg&file=_
<img src="__POSTER__.jpg" width="640" height="360" />
<p>
<strong>No video playback capabilities detected.</strong>
Why not try to download the file instead?<br>
MPEG4
Ogg Theora
</p>
</object><!--[if gt IE 6]><!-->
</object><!--<![endif]-->
</video>
</body></html>
The above code is the code that used to work, but got broken.
Final solution that worked for me: Manual clean of the 3rd party taint from my MP4 videos.
There are many options to clean and re-encode an MP4 video, some free others non-free. One way is open the MP4 file with VLC or other video player or software that has and open/save/reencode/convert tools in it, and save it out to a different video encoding format.
I was able to cook up a handy dandy script in Java to iterate over every MP4 file crack open the MP4 file, clean out the hobo taint if it exists then save and redeploy the mp4 file, and now all is well. Then do this on a schedule.
Other solutions considered, but rejected:
Eliminate the bugged HTML5 video embed tag from your tool set. Display an image with an html5 <img .../> tag, overlay a play button so as to indicate this is a video, when the user clicks either open a new tab where the raw MP4 video plays in browser: the volume button is shown correctly, or worst case the user downloads the MP4 video to disk, and they can open it up from disk with their video player.
Use a different browser or an open source browser, that know how to do the right thing.
Try toggling on the 'new media controls' chrome://flags, maybe at some point in the future the Chrome Devs will push a fix and it won't freak out on the evidence that the mp4 smells of digital rights violations.
Yield the vanguard and eyeball click revenue to the big player content providers, just use an whatever tag to redirect users to the websites who are able to show video correctly.
The game is afoot make your time.
It seems that you are using a mute video. Because of that, the volume control is not showing.
Check this out:
<video src='https://www.w3schools.com/tags/mov_bbb.mp4' controls>
</video>
Related
I'm trying to use the html5 video tag to embed an mp4 but I'm having some issues that vary across different browsers.
My code looks like this:
<video controls="controls" width="640" height="360">
<source src="http://www.mydomain.com/video.mp4" type="video/mp4" />
</video>
IE - Won't recognize the file when trying to embed (edit: IE was actually dragging on the file size not the format) and when the uri to my video is plugged into the address bar it opens the video in windows media player.
Chrome, Firefox - Simply will not recognized the file format (edit: Firefox was dragging on the size as well, Chrome was the only browser having issues) and when the uri is plugged into the address bar it attempts to play the video within the browser but fails.
Could there be something within the file that would prevent it from being embedded? If so, how can I find this out?
The problem is likely that the browsers are not supporting MP4, because it is a proprietary format. To get the best cross-browser support you'll have to also encode your video in WebM and Ogg/Vorbis formats and then add those files to your video tag with their own source tags.
Just because a browser will play a video if you navigate directly to the video's URL does not mean that the browser supports that format. Usually, navigating straight to the video causes the browser to play the video with a plug-in such as Quicktime or VLC that has much better codec support than the browser does.
try this without that "/"
<video controls="controls" width="640" height="360">
<source src="http://www.mydomain.com/video.mp4" type="video/mp4" >
<source src="http://www.mydomain.com/video.ogg" type="video/ogg" >
</video>
Can I vent for a minute -- Mozilla released Firefox 21.0 not long ago and it's supposed support for H.264 video is confusing to say the least.
I noticed that FF21 changes the HTML5 video tag to an object tag when the page loads.
This code that I wrote ...
<video controls='controls' preload='none' width='320' height='240'>
<source src='test.mp4' type='video/mp4' />
</video>
... automagically becomes this code after the page loads ...
<object width="320" height="240" type="application/x-ms-wmp" uimode="full">
<param name="autostart" value="false">
<param name="url" value="test.mp4">
</object>
Why does FF21 change the code from VIDEO to OBJECT? I'm on Windows 7, so I'm not surprised my HTML5 video becomes an IE player -- but is this true HTML5 support?
By the way, this isn't a big deal if you've hard-coded the URL of the video file into the source attribute. But if you're loading the video dynamically, does this mean developers have to start manipulating the PARAM/URL attribute instead of the VIDEO/SOURCE attribute IF the user is using FF21+ on Windows7? My if/else statements for loading the proper video file are growing with every new browser release/upgrade.
Running FF21 on Windows 7 here - not seeing this behavior. The page loads, the video plays and Firebug shows the video tag intact. Could this be caused by an add-on / extension?
I have created 3 versions of a video file using Miro Video Converter to facilitate different browsers and I am using the following code to play them...
<video class="rw-video video-js" data-settings="rw-green rw-flat-color rw-rounded" title="My movie title" preload="auto" controls width="800" height="400" id="exampleVid1" poster="images/video.png" >
<source src="images/movie1.mp4" type="video/mp4" />
<source src="images/movie1.ogv" type="video/ogg" />
<source src="images/movie1.webm" type="video/webm" />
<p>Your browser does not support the video tag.</p>
</video>
The video plays just fine in firefox and safari but not in chrome - it appears to play in chrome but never starts - the hourglass just goes round and round and it never plays. I have checked filenames and that the video is uploaded. Any ideas? I wondered if Chrome maybe interprets "preload="auto"" to mean preload the entire video but fiddling with that didnt make any difference I could see. The movies are around 50mb in total and load instantly in other browsers.
this is actually a Google Chrome bug which prevents it to load more than 6 MP4 videos. Try putting preload="none" on all the videos and then start clicking on them. You will probably be able to open 6 of them but on 7th video Google Chrome will hang. That is how it is with me, but maybee this will happen sooner on your system.
But you will trigger the bug if you have MP$ video among your videos, so it is best to completely avoid the MP4 format. I solved it completely by using webm video format.
I am designing a site for an ad production company that want to be able to upload location scouting and casting videos. I have figured out how to get the data out of sql and into the browser with proper headers.
Now my issue is - what is the best way to display video at present. I need it to work on iPhones, iPads, Safari and Firefox. I don't care about IE at all.
I don't mind restricting them to uploading in only one video format if that helps. Meaning Quicktime .mov only or .m4v only - whatever works. Can't use Flash as iPhones and iPads are involved.
I also have no issue accommodating each different browser with different code. I just need to know which method is best for which platform/browser.
EDIT:
I have figured out how to display the video from the database in the computer browsers I care about (excludes MSIE). Now I need to figure out the iPhone. To test, I put the files into the server's files system and they all play from there via the html5 video tag. So the iPhone is capable of playing the clips' formats. The issue is apparently passing that data to the iPhone from mySQL... Currently, my php file that retrieves the binary data and sends it to the browser specifies the following headers:
header("Content-length: $audioLength");
header('Content-Range: bytes 0-'.$audioLength.'/'.$audioLength);
header("Content-type: ".$mimeType);
where $audioLength is the file size in bytes captured on upload
$mimeType is the mime type as reported by the browser at upload - both values are passed to the retrieve_audio.php script form the database along with the binary data.
What other headers may be necessary? How would I find out what the difference is between getting the file from the filesystem versus the database?
Is is possible the issue is that the iPhone doesn't retrieve the data until you press the play button? As a last resort, I could have the PHP code write the file(s) to the filesystem, but that is duplication of data that I would like to avoid, if possible...
Thanks,
M
Check out http://diveintohtml5.ep.io/video.html for great info on HTML5 video and different formats.
Simplified short answer: Firefox 4 supports Ogg (Theora/Vorbis) and WebM; Safari (desktop and mobile) supports MP4 (H.264/AAC). Try using the HTML5 <video> tag like this:
<video width="320" height="240" controls>
<source src="pr6.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'>
<source src="pr6.webm" type='video/webm; codecs="vp8, vorbis"'>
<source src="pr6.ogv" type='video/ogg; codecs="theora, vorbis"'>
</video>
(Example from site linked above. Seriously, it's a really good read, and it will also tell you how to make sure your video does work in IE, Chrome, etc.)
EDIT If you absolutely need to only use one video format, your best bet is probably MP4/M4V with H.264 video and AAC audio. Safari (desktop and mobile) can play it in the <video> tag, and Firefox will be able to play it in a Flash container. It's not ideal, because I think you'll have to do some browser sniffing to make sure iOS doesn't get Flash and Firefox does, but you'll want something like this:
<!-- Safari and iOS -->
<video width="320" height="240" poster="poster.jpg" controls>
<source src="video.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'>
</video>
<!-- Firefox / other -->
<object width="320" height="240" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">
<param value="player.swf">
<param value="true" name="allowfullscreen">
<param value="always" name="allowscriptaccess">
<param value="file=video.mp4&image=poster.jpg" name="flashvars">
<embed
width="320"
height="240"
flashvars="file=video.mp4&image=poster.jpg"
allowfullscreen="true"
allowscriptaccess="always"
src="player.swf"
type="application/x-shockwave-flash"
>
</object>
Even if you go this route, though, I'd still read the Dive Into HTML5 page for more info about the appropriate codecs to use, how to encode the video, and various problems to look out for.
Unfortunately there is no single format that works well on such a wide variety of devices. You'll need to take whatever format is uploaded and convert it into a number of different formats. You might want to look into a service like http://www.livetranscoding.com/ to do the heavy lifting (note, I've not used their services and I don't know if there's a way to get it to work with non-live streams).
I'm working on a very small site, with almost zero budget as a favor for a friend. She wants to put a short audio and video clip on the site (both clips are under two minutes). The audio is currently a 1.6 MB AAC (.m4a) and the video is a 30 MB H.264 (.mov).
What's the current best practice that's going to be the easiest for me, while still creating a good experience for the users? Should we upload the video to youtube or vimeo and embed? There's probably some simple audio player I could download. I have flash, so could make an FLV; I could convert the m4a to an mp3, etc. I could just link directly to the raw files....
Outsource it.
Youtube
Blip.tv (FAQ)
Vimeo (Basics)
Many popular video sites use Blip.tv
Thatguywiththeglasses
Cinemassacre
And others use Youtube
Screwattack
In terms of being modern and standards compliant for video embedding, Video for Everyone is probably the best way.
<!-- “Video for Everybody” by Kroc Camen <camendesign.com> cc-by -->
<video width="640" height="480" controls="controls">
<source src="__MY_VIDEO__.ogv" type="video/ogg" />
<source src="__MY_VIDEO__.mp4" type="video/mp4" />
<object width="640" height="500" type="application/x-shockwave-flash"
data="__FLASH_PLAYER__.swf" flashvars="file=__MY_VIDEO__.mp4"
> <param name="movie" value="__FLASH_PLAYER_.swf" />
<param name="flashvars" value="file=__MY_VIDEO__.mp4" />
<!--[if gt IE 6]>
<object width="640" height="495" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B">
<param name="src" value="__MY_VIDEO__.mp4" /><!
[endif]--><!--[if gt IE 6]><!-->
<object width="640" height="495" type="video/quicktime" data="__MY_VIDEO__.mp4"
> <param name="src" value="__MY_VIDEO__.mp4" />
<!--<![endif]--><p>
<strong>No video playback capabilities detected.</strong>
Why not try to download the file instead?<br />
MPEG4 / H.264 “.mp4” (Windows / Mac) |
Ogg Theora & Vorbis “.ogv” (Linux)
</p><!--[if gt IE 6]><!--></object><!--<![endif]-->
<!--[if gt IE 6]></object><![endif]-->
</object>
</video>
A fully commented version is available at the link above.
This uses the video tag if it's supported, but as Firefox and Safari both support different formats (Ogg and Mp4) you need to have a couple of different versions of the video files.
This works on every browser, from IE6 to the iPhone, and from Chrome to Opera including everything in between.
For audio, the audio tag is the most modern, though I'm not sure about browser support at the moment.
Uploading to a service like YouTube, Blip.tv, or Vimeo is good, but you'll have to settle for them tossing in "related videos" or other ads on your content, and you'll be forced to stick with their player/branding.
You could get the JW FLV Media Player, and play the .mov through flash. And actually, if you go with blip, they will host the file and give you the absolute path to the .flv itself - meaning you could load it directly into your local copy of JW FLV Player, and likely bypass their ads/related content.
Another nifty thing to consider would be the jQuery Media Player. It quickly converts markup/css into a media-player driven by the powerful jQuery framework. Using this with the free hosting provided by Blip.tv (who again give you direct access to your .flv files) would be a great solution too.
for the video, I recommend to use youtube. you can embed into your pages without sacrificing spaces and bandwith.
For the sound, i would recommend to use mp3 (not aac since not everybody has aac) and then you can put flash mp3 player (try this : 5 best flash podcast players)
For mp3, if it is a speech or just human talking about something, you don't need to make stereo, mono is more than enough. You can edit using Audacity (free-open source software). I guest (from my past experience) 1 hour speech could be 5-6 MB mono mp3 (about 96Kbps if i am not wrong)