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
Related
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.
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
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.
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.
Hi I'm trying to validate my website but it complains about my slideshow
Is this because its using html? Should I ignore it?
validator link
<embed
src="http://artygirl.co.uk/imagerotator/imagerotator.swf" width="632px" height="308px"
flashvars="file=http://artygirl.co.uk/imagerotator/rotator.xml&transition=blocks&shownavigation=false"
/>
Thanks for your help
Regards
Judi
According to the HTML spec, (rather than ) is the tag to use for embedded content. Unfortunately, Internet Explorer supports the tag, which FF, Chrome, Safari, etc support the tag.
So how do you create valid content with Flash embedded?
After a web page has loaded, you can
insert the embed tag, effectively
circumventing the XHTML problems. As a
bonus, you can use JavaScript to
determine whether the correct Flash
Plugin is available on your visitor's
computer. If it isn’t, alternative
content can be loaded.
– LongTail Video's Embedding Flash tutorial
Hopefully this answers your question about how to embed your content in a standards compliant way.
Best,
Zach
Developer, LongTail Video