weather.yahoo.co.jp and other Yahoo Japan sites - videos do not play
URL: http://weather.yahoo.co.jp/weather/video/?c=38747 Browser / Version: Firefox 38.0 Operating System: Android Problem type: Video doesn't play
Steps to Reproduce
- Navigate to: http://weather.yahoo.co.jp/weather/video/?c=38747
- No video appears
This is a generic problem with the video player script that plays video on many yahoo.co.jp properties: the code that detects Android version has a bug. Right now it looks like this:
if(e&&(b=/Android (\d)/i.exec(a),b[1]))return n("Android major version :"+b[1]),b[1];return n("Unknown os major version"),null
The way it is written, the develop intended to handle unknown versions. However, because the comma operator is used the b[1] will run even if the exec() statement doesn't match anything. If b is null, getting b[1] will throw and the browser detection fails. When the browser detection fails, we end up without a video player.
This very small rewrite would make the code behave as intended:
if(e&&((b=/Android (\d)/i.exec(a))&&b[1]))return n("Android major version :"+b[1]),b[1];return n("Unknown os major version"),null
and videos would play in Firefox Android across *.yahoo.co.jp sites that rely on this script.
The script is here: http://i.yimg.jp/images/yvpub/player/js/player.js
country: jp
Mozilla Japan will contact Yahoo! Japan soon. Including other issues related to Yahoo! Japan. #1019, #1015,#1012,#1017,#1018,#1088,#1023,#1020,#1087, and https://bugzilla.mozilla.org/show_bug.cgi?id=956972
This is fixed by us adding the Android version to the UA string. Just confirmed that it's working.