From 4c4f982b26c8132f37ece95df997e668fe3e19c4 Mon Sep 17 00:00:00 2001 From: mderrick Date: Wed, 26 Jul 2017 16:09:06 +0100 Subject: [PATCH] Temporarily fix #63 and #75 iOS spinner always showing --- src/DefaultPlayer/DefaultPlayer.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/DefaultPlayer/DefaultPlayer.js b/src/DefaultPlayer/DefaultPlayer.js index 559d7a3..3e30813 100644 --- a/src/DefaultPlayer/DefaultPlayer.js +++ b/src/DefaultPlayer/DefaultPlayer.js @@ -128,7 +128,10 @@ export default videoConnect( readyState, networkState, error: error || networkState === 3, - loading: readyState < 4, + // TODO: This is not pretty. Doing device detection to remove + // spinner on iOS devices for a quick and dirty win. We should see if + // we can use the same readyState check safely across all browsers. + loading: readyState < (/iPad|iPhone|iPod/.test(navigator.userAgent) ? 1 : 4), percentagePlayed: getPercentagePlayed(restState), percentageBuffered: getPercentageBuffered(restState), ...restState