Embedding video for all browsers (including Mac Firefox!) - macos

I've seen a bunch of threads around referencing various video embedding issues. Unfortunately I'm not in a position to serve my assets off of a CDN (or Youtube, Vimeo, etc) so have resorted to working with multiple formats. I've got .mp4, .ogg, and .swf.
I'm continuing to get an error in Firefox (Mac) regarding "no video of the requested MIME type can be found." I've added mp4 and ogg to my .htaccess file to no avail.
Which makes me think there must be something slightly wrong with my code. I've used a combination of the suggested methods I've found online. I'm hoping I've done something so obviously daft that it will stick out like a sore thumb to someone in the know.
<video width="757" height="425" controls id="player">
<source src="video.mp4" type="video/mp4">
<source src="video.ogg" type="video/ogg">
<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" width="757" height="425" >
<param name="src" value="video.mp4">
<param name="controller" value="true">
<embed SRC="QTMimeType.pntg" type="image/x-macpaint" pluginspage="http://www.apple.com/quicktime/download" qtsrc="video.swf"
width="757" height="425" autoplay="false" controller="true">
</embed>
</object>
</video>
Many thanks in advance for taking a look at this. Feeling pretty stupid right now.

Related

mkv issue in firefox

I've been searching for this a lot, and I think it is not possible but for being sure:
I have some MKV video files which I want to put them on my website. The problem is you can't
play them in firefox and it only works in chrome browser. I'm using html5 player(js player).
<video id="example_video_2" class="video-js vjs-default-skin" controls preload="auto" width="800" height="600" poster="<?php echo $teacher_pic ;?>" data-setup='{"example_option":true}'> <source src='<?php echo $video_url;?>' type='video/mp4' /> </video>
<script>
videojs.options.flash.swf = "video/video-js/video-js.swf"
</script>
I also tried "Video for Everybody" player but it didn't help.
So , is it related to player or not ? is it basically possible to play my videos in firefox?
Hm, could this link help you - http://www.videolan.org/doc/vlc-user-guide/en/ch07.html
If not, maybe you could try adding a type type="video/x-matroska" and the explanation is here: https://support.mozilla.org/en-US/questions/948571

Visual Studio 2010 Missing HTML5 Video?

Working with HTML5 within VS2010, I don't understand how the source tags aquire the path for the video. I assume it either can be Absoulute or Relative.
What I am attempting is very simple:
<video id="my_video" width="480" height="300" controls preload="none" poster="webm/art_leaf_resized.jpg">
<source src="webm/Along_the_Path.mp4" type="video/mp4" />
<source src="webm/Along the Path.webm" type="video/webm" />
<source src="webm/Along the Path.ogv" type="video/ogg" />
</video>
However, Pressing F5 in VS2010, Firefox and IE9 can not locate the video displaying an X. Chrome is able to find the video and play it.
The poster image shows correctly and isn't missing. The poster image is in the same directory as the videos?
File Directory:
A basic HTML page (HTMLPage1.htm) holds only the video element.
<!DOCTYPE html>
<html lang="en">
<head>
<title></title>
</head>
<body>
<video id="my_video" width="480" height="300" controls
preload="none" poster="webm/art_leaf_resized.jpg">
<source src="webm/Along_the_Path.mp4" type="video/mp4" />
<source src="webm/Along the Path.webm" type="video/webm" />
<source src="webm/Along the Path.ogv" type="video/ogg" />
</video>
</body>
</html>
Closing VS2010 and opening IE9 and dragging in the htm page, the video is able to play in IE9, Firefox, and Chrome. I believe VS2010 is doing something?
I have been working with for some time now. I believe that I am not thinking, which it probably is something very simple.
Any help would be appreciated.
Thank you,
deDogs
I agree with the people in the comments that it might be an ASP.NET Development Server issue. Try two things: Publish the site to a legitimate local web server and try to open it from there. Also, for the dev server see if adding "~/" to the front of your urls helps anything.
After returning to this project, I found the answer to why HTML Videos were missing.
My findings can be read at my blog: Visual Studio Development Web Server, mp4 isn’t part of the set of built in known Mime types.
Thank you,
deDogs

How do show an local video using ASP.Net MVC 3

I have a Video Content/Videos/samsung.mp4. I want to show that video but I can't seem to access it in the view, I am not sure what C# code I should use to access the resource.
This doesn't show the video:
#{
ViewBag.Title = "Some site!";
var videourl = Url.Content("/Content/Videos/samsung.mp4");
}
<h2>Some site this is!</h2>
<p>
<video>#videourl</video>
</p>
<video> is a HTML5 element and it does support MP4 videos.
But the browser may not. Which browser and version are you using?
Also, your syntax above is incorrect. The correct syntax for the video element with an MP4 video would be:
<video src="samsung.mp4"></video>
Alternatively you can serve up different formats to different browsers (which is recommended) with:
<video>
<source src="samsung.ogg" type="video/ogg">
<source src="samsung.mp4" type="video/mp4">
<source src="samsung.webm" type="video/webm">
Your browser doesn't support the video element
</video>
Have a look at the Microsoft Web Helpers package. There is a Video helper to do just this.
More details at http://msdn.microsoft.com/en-us/library/microsoft.web.helpers(v=VS.99).aspx
You can download the package from Nuget.
You need to embed it in a Quicktime player or another thats supports mp4. it doesn't have anything to do with c# more HTML/javascript.
Not sure the code needed but the above information will be enough to find it on google

How to get the src for a video with multiple sources?

I'd like to be able to get the src value that is actually used for a video element like the following:
<video>
<source src="foo.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'>
<source src="foo.webm" type='video/webm; codecs="vp8, vorbis"'>
<source src="foo.ogv" type='video/ogg; codecs="theora, vorbis"'>
</video>
In Firefox (at least), src is defined for the source elements but not for the video element.
How can I find which source is used?
I think I've answered my own question: the currentSrc property of the video element.
This works in Firefox, Safari (and Chrome, I assume) on Windows XP SP3, at least.
UPDATE: as was pointed out to me in the comments below, there is documentation of currentSrc in the WHATWG spec.

HTML5 video (mp4 and ogv) problems in Safari and Firefox - but Chrome is all good

I have the following code:
<video width="640" height="360" controls id="video-player" poster="/movies/poster.png">
<source src="/movies/640x360.m4v" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'>
<source src="/movies/640x360.ogv" type='video/ogg; codecs="theora, vorbis"'>
</video>
I'm using Rails (Mongrel in development and Mongrel+Apache in production).
Chrome (Mac and Win) can play either file (tested by one then the other source tags) whether locally or from my production servers.
Safari (Mac and Win) can play the mp4 file fine locally but not from production.
Firefox 3.6 won't play the video in either OS. I just get a grey cross in the middle of the video player area.
I've made sure that both Mongrel and Apache in each case have the right MIME types set.
From Chrome's results I know there is nothing inherently wrong with my video files or the way the files are being asked for or delivered.
For Firefox I looked at https://developer.mozilla.org/En/Using_audio_and_video_in_Firefox where it refers to an 'error' event and an 'error' attribute. It seems the 'error' event is thrown pretty well straightaway and at that time there is no error attribute. Does anyone know how to diagnose the problem?
The HTTP Content-Type for .ogg should be application/ogg (video/ogg for .ogv) and for .mp4 it should be video/mp4. You can check using the Web Sniffer.
Add these lines in your .htaccess file and it will work for all browsers. Works for me.
AddType video/ogg .ogv
AddType video/mp4 .mp4
AddType video/webm .webm
If you dun have .htaccess file in your site then create new one :) its obvious i guess.
Incidentally, .ogv files are video, so "video/ogg", .ogg files are Vorbis audio, so "audio/ogg" and .oga files are general Ogg audio, so also "audio/ogg". Checked in Firefox and work. "application/ogg" is deprecated for all audio or video uses. See http://www.rfc-editor.org/rfc/rfc5334.txt
I see in the documentation page an example like this:
<source src="foo.ogg" type="video/ogg; codecs="dirac, speex"">
Maybe you should enclose the codec information with " entities instead of actual quotes and the type attribute with quotes instead of apostrophes.
You can also try removing the codec info altogether.
Just remove the inner quotes - they confuse Firefox. You can just use "video/ogg; codecs=theora,vorbis".
Also, that markup works in my Minefiled 3.7a5pre, so if your ogv file doesn't play, it may be a bogus file. How did you create it? You might want to register a bug with Firefox.
Just need to change one letter:),
rename 640x360.ogv to 640x360.ogg,
it will work for all the 3 browers.

Resources