I need streaming video in Safari for iPhone / iPad with the best quality.
I created 2 video files: one in low quality for slow 3G speed, one in high speed Wi-Fi broadband. I noticed that some applications (e.g. YouTube) can determine if a 3G or Wi-Fi mobile device is working, and therefore choose small video rather than high quality video.
Now this is my DOM / Javascript code, the value of $ v is replaced by PHP and contains the video file name:
<video id="thevideo" src="streaming/video_<?=$v ?>.m4v" width="600" height="360" width="640" height="360" preload="preload" controls="controls" autoplay="autoplay">
flowplayer/video<?=$v ?>.m4v
</video>
<script type="text/javascript">
var myvideo = document.getElementById("thevideo");
myvideo.load();
myvideo.play();
</script>
Can I write something in Javascript / Webkit able to detect connection mode?
Thanks to everyone.
source
share