What is the best way to provide online video that also works on iPhone / iPad?

Is there a general way to implement video on the Internet that will also work on iPhone / iPad?

My idea is to provide two versions (Flash and HTML5) and check with JavaScript, if HTML5 is supported - if so, then play Flash; if not, play HTML5. Maybe the best way?

+3
source share
4 answers

You can use the HTML5 tag videoas the default parameter and place the tag in it object.

HTML5 video Safari ( Mobile Safari): http://developer.apple.com/library/safari/#documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/Introduction/Introduction.html

+1

HTML5, : http://diveintohtml5.ep.io/video.html

HTML5,   Flash, script Android:

<video id="movie" width="320" height="240" preload controls>
  <source src="pr6.webm" type='video/webm; codecs="vp8, vorbis"' />
  <source src="pr6.ogv" type='video/ogg; codecs="theora, vorbis"' />
  <source src="pr6.mp4" />
  <object width="320" height="240" type="application/x-shockwave-flash"
    data="flowplayer-3.2.1.swf"> 
    <param name="movie" value="flowplayer-3.2.1.swf" /> 
    <param name="allowfullscreen" value="true" /> 
    <param name="flashvars" value='config={"clip": {"url": "http://wearehugh.com/dih5/pr6.mp4", "autoPlay":false, "autoBuffering":true}}' /> 
    <p>Download video as <a href="pr6.mp4">MP4</a>, <a href="pr6.webm">WebM</a>, or <a href="pr6.ogv">Ogg</a>.</p> 
  </object>
</video>
<script>
  var v = document.getElementById("movie");
  v.onclick = function() {
    if (v.paused) {
      v.play();
    } else {
      v.pause();
    }
  };
</script>
+4

Source: https://habr.com/ru/post/1795227/


All Articles