From 37a6e015cdd88f29175b6aa336ec9b7230c0a74f Mon Sep 17 00:00:00 2001 From: Christian Ebert Date: Tue, 7 Oct 2014 18:01:47 +0100 Subject: [PATCH] ipad: fixes for iOS 8 (#266) - remove href attribute from Flash container; if the container is an anchor, clicking on the wrapping anchor opens the link otherwise - do not try to auto play live videos, the player is stuck on the first image otherwise - still transitions well to a live stream in a playlist --- js-plugins/ipad/flowplayer.ipad.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/js-plugins/ipad/flowplayer.ipad.js b/js-plugins/ipad/flowplayer.ipad.js index f820880..495796d 100644 --- a/js-plugins/ipad/flowplayer.ipad.js +++ b/js-plugins/ipad/flowplayer.ipad.js @@ -360,13 +360,22 @@ $f.addPlugin("ipad", function(options) { $f.fireEvent(self.id(), 'onBegin', activeIndex); log("calling video.load()"); - video.load(); + if (! clip.live ) // iOS 8 chokes otherwise + video.load(); } // auto if ( autoPlay ) { log("calling video.play()"); - video.play(); + if ( clip.live ) { + // timeout required for iOS 8, live stream not recognized, + // only the current m3u8 segment list duration + setTimeout(function () { + video.play(); + }, 1); + } else { + video.play(); + } } } @@ -902,6 +911,10 @@ $f.addPlugin("ipad", function(options) { while(root.firstChild) root.removeChild(root.firstChild); + // do not follow video link - crucial for iOS 8 + if (root.hasAttribute("href")) + root.removeAttribute("href"); + var container = document.createElement('div'); var api = document.createElement('video'); container.appendChild(api);