problem with particular website [SOLVED]

Questions about codecs, DVD playback, web plugins...
Forum rules
Before you post please read this

problem with particular website [SOLVED]

Postby andy chung on Wed Apr 24, 2013 6:09 am

have already installed
- adobe flash player plugin
- ubuntu restricted extras

could play videos in most websites without problems.

but not below one,
http://cablenews.i-cable.com/webapps/pr ... d=12152381

any ideas? tks.
Last edited by andy chung on Wed May 01, 2013 12:40 am, edited 3 times in total.
Image
Petra 32 bit, KDE, Fedora 20, win7 triple boot
andy chung
Level 1
Level 1
 
Posts: 21
Joined: Mon Apr 01, 2013 11:58 am
Location: China Hong Kong

Linux Mint is funded by ads and donations.
 

Re: problem with particular website

Postby grimdestripador on Wed Apr 24, 2013 10:41 pm

Solution:

To change your useragent in chromium. Click the wrench (or tripple lines) in the upper right hand corner. Select Tools. Select Developer Tools. Click the settings gear icon in the lower right. Click Overrides. Click User Agent Check Box. I selected Useragent for Firefox7--Windows.

Sucess!!!! I'm watching the wall street video you posted.


Explanation:
Looking into the site. I notice a javascript file is customized through php for each page load, named jw_player.php. When you go to a web site, your browser sends a user agent string. This site, customizes the content for the browser loaded. I can see why the page won't load, because they are looking for if linux and android appear in your user agent string. For example, my useragent string when using chromium is...

Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.17 (KHTML, like Gecko) Ubuntu Chromium/24.0.1312.56 Chrome/24.0.1312.56 Safari/537.17


If you inpsect the source of jw_player.php. You notice that line 37 searches for both linux and android. It seems if the "&&" on line 37 was changed to "||" the site would work correctly.

Code: Select all
31#/*Device Detection START*/
32#function deviceDetection(){
33#   var num = 0;
34#   var userAgent = navigator.userAgent.toLowerCase();
35#   if ((userAgent.search("android") > -1)){ // Android
36#      return num=1;
37#   }else if ((userAgent.search("linux") > -1) && (userAgent.search("android") == -1)){ // Linux
38#      return num=2;
39#   }else if ((userAgent.search("ipad") > -1) || (userAgent.search("iphone") > -1) || (userAgent.search("ipod") > -1)){ // iPad/iPhone/iPodd
40#      return num=3;
41#   }else if ((userAgent.search("msie 7.0") > -1)){ // Internet Explorer 7.0 version
42#      return num=4;
43#   }
44#}


If you would like to send a bug report to them (The site is all in chineese, so am unable). Consider my following modification which is untested but expected to work.
Code: Select all
37#   }else if ((userAgent.search("linux") > -1) && ((userAgent.search("android") == -1) || (userAgent.search("i686")==-1))) { // Linux
Last edited by grimdestripador on Thu Apr 25, 2013 1:50 pm, edited 1 time in total.
User avatar
grimdestripador
Level 6
Level 6
 
Posts: 1069
Joined: Fri Feb 16, 2007 2:26 am

Re: problem with particular website

Postby andy chung on Thu Apr 25, 2013 11:09 am

thank you grimdestripador! worked for me. saved my day switching to windows back and fro. :lol:

have written to the site for the correction including the link of this thread via their contact us (in chinese) button.

have installed extensions in chrome (and firefox also) to change user agent more easily.
Image
Petra 32 bit, KDE, Fedora 20, win7 triple boot
andy chung
Level 1
Level 1
 
Posts: 21
Joined: Mon Apr 01, 2013 11:58 am
Location: China Hong Kong

Re: problem with particular website

Postby grimdestripador on Thu Apr 25, 2013 1:39 pm

Now that i read, it seems i made a logic error when offering a solution to their code. I didn't notice the difference in use between ">-1" and "==-1". Looking at it now, it looks like the ==-1 represents 'not found'.

Either way, the solution of changing the useragent by acting like windows continues to work. I'll remember this in my bag-of-tricks, for when websites refuses to load. I've personally never had to change my user agent string before.
User avatar
grimdestripador
Level 6
Level 6
 
Posts: 1069
Joined: Fri Feb 16, 2007 2:26 am


Return to Sound, Multimedia, & Codecs

Who is online

Users browsing this forum: No registered users and 2 guests