From 714915b0a8f63b56fba1cf45dbe54a80b799fa86 Mon Sep 17 00:00:00 2001 From: cat Date: Tue, 10 May 2016 12:45:53 +0200 Subject: [PATCH] embed code: firefox and mp4 issues --- src/embed.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/embed.js b/src/embed.js index d9f3b04c..dc66361c 100644 --- a/src/embed.js +++ b/src/embed.js @@ -57,6 +57,25 @@ function mistembed(streamname) { //IE <= 9 doesn't support MP4, Firefox seems to correctly see it now. return false; } + if (navigator.userAgent.indexOf('Firefox') > -1) { + //firefox claims to support MP4 but doesn't when: + // - under win xp + // - the stream is live + + if (video.type == 'live') { + return false; + } + //find "Windows NT X;" in user userAgent + //sorry, I don't like regexes.. I avoid them when I can :$ + var s = navigator.userAgent.split('Windows NT '); + if (s.length > 1) { + s = s[1].split(';'); + s = s[0]; + if (Number(s) <= 5.1) { + return false; + } + } + } }