Project Description
Video streamer that support single Range.
it will handle video streaming especially MP4, for iphone and ipad.
and will return the whole file for Request that doesn't use http_range like desktop browsers
Detail

You can than use it on your html 5 video tag.

        <video width="340" height="285" id="htmlvidplayer" controls="" poster="/video/output/53_big.jpg" tabindex="0">
<source id="mp4" src="services/VideoStreamer.ashx?fn=53.mp4" type="video/mp4">
</source></video>


Or directly Redirect to that url, because of built in quicktime player on that mobile device.

 

         <a href="services/VideoStreamer.ashx?fn=53.mp4*">
<img src="video/output/53_big.jpg"/>
</a>



Related to how to build Cross browser video. well in my case it's only IOS use HTML5 or Desktop Browser use flash.
this is the Javascript Example:

function LoadMediaPlayer(fileName, thumbnailPic) {
var videocontainerid='mediaplayer';
var x = document.getElementById('htmlvidplayer');
if(x)
document.getElementById(videocontainerid).removeChild(x);
if (!isIOS() && !isAndroid()) {
var so = new SWFObject("../mplayer/TFMP13.swf", "mediaplayer", "480", "345", "8", "#000000");
so.addParam("allowFullScreen", "false");
so.addVariable("MediaLink", fileName);
so.addVariable("image", thumbnailPic); // preview image
so.addVariable("imageScaleType", "1");
so.addVariable("logo", "../images/tf_logo_small.png"); // logo image file
so.addVariable("logoLink", "http://www.something.com"); // when logo is clicke
so.addVariable("logoTarget", "_blank"); // target frame when logo is clicked
so.addVariable("playOnStart", "false");
so.addVariable("startVolume", "50"); // 0-100
so.write(videocontainerid);
}

else {
//use video tag
fileName = fileName.substring(fileName.lastIndexOf('/') + 1);
var v = document.createElement("video");
v.id = 'htmlvidplayer';
v.width = '480';
v.height = '345';
v.controls = true;
v.poster = thumbnailPic;
var mp4 = document.createElement('source');
mp4.id = 'mp4'; mp4.src = '/services/VideoStreamer.ashx?fn=' + fileName; mp4.type = 'video/mp4';
v.appendChild(mp4);

var g = document.getElementById(videocontainerid);
g.appendChild(v);
}
}

Last edited Jun 13, 2011 at 5:22 AM by cipto0382, version 7