The video tag I'm building will not work in IE9. Its works ok in Firefox and Chrome.
I added the mime to the IIS 7.5 server Extension=.mp4 Mime Type=video/mp4
I create the elements with jQuery using this code
function fsuccLoadVideo(data) {
var arr = GetNormalizeMetadataClean(data);
var vid = $('<video width=400 height=300 controls poster=' + arr[0]["CntrTestVideoImage"] + '/>');
var loc = window.location.href;
var idx = loc.lastIndexOf('/') + 1;
var mp4loc = loc.substr(0, idx)+ arr[0]["CntrTestVideoMp4Src"];
loc = loc.substr(0, idx)+ arr[0]["CntrTestVideoOggSrc"];
if ((arr[0]["CntrTestVideoMp4Src"] != undefined) && (arr[0]["CntrTestVideoMp4Src"].length > 0)) {
$("<source />", { src: loc, type: 'video/webm; codecs="vp8, vorbis"' }).appendTo(vid);
$("<source />", { src: mp4loc, type: 'video/mp4; codecs="avc1.42E01E, mp4a.40.2"' }).appendTo(vid);
$("<source />", { src: loc, type: 'video/ogg; codecs="theora, vorbis"' }).appendTo(vid);
$(vid).append("Your browser does not support the video tag");
$("#videosection").append(vid);
}
}
and it renders on the browser this way:
<source
src="http://10.1.16.102:90/Intranet/safety/contractortest/video/cntrTest1.ogg"
type="video/webm; codecs="vp8, vorbis"">
(can't get formatting correct to show full rendering, but here is the critical line
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…