Plugins Plugins can make site-specific changes to the proxy's behavior and parsing mechanisms. You can use plugins to overcome limitations of the base proxy script.


Closed Thread
 
LinkBack Thread Tools Display Modes
Old 04-11-2008, 12:19 AM   #41 (permalink)
Junior Member
 
Join Date: Feb 2008
Posts: 10
MyMe
Default Re: Youtube - Fresh new thread...

i can make it work in firefox 3 beta 5
MyMe is offline
Country: Romania
 
Old 04-11-2008, 09:07 AM   #42 (permalink)
Junior Member
 
Join Date: Apr 2008
Posts: 1
1EightT
Default Re: Youtube - Fresh new thread...

Doesn't work for me in ff3 or IE7. The videos never load, but the player is shown now.
1EightT is offline
Country: United States
 
Old 04-12-2008, 12:14 AM   #43 (permalink)
Senior Member
 
Join Date: Feb 2008
Posts: 142
kevin186
Default Re: Youtube - Fresh new thread...

works good using ff2, safari, and opera on my vista laptop and using ff2 on my fedora box. but, i have never had it work using ie7. i noticed that the cgi proxies work in youtube using ie7, so i guess its possible.
kevin186 is offline
Country: United States
 
Old 04-12-2008, 12:23 AM   #44 (permalink)
Junior Member
 
Join Date: Feb 2008
Posts: 11
AutoX
Default Re: Youtube - Fresh new thread...

Just tested with IE7, works fine for me, ,

Also it works with FF ver 2.0.0.13...


BTW I am using Glype 0.5.3
AutoX is offline
Country: United States
 
Old 04-13-2008, 03:29 AM   #45 (permalink)
Junior Member
 
Join Date: Mar 2008
Posts: 29
darkness193
Default Re: Youtube - Fresh new thread...

YouTube has now updated their site again and the plugin works in Firefox and Internet Explorer however the fullscreen support seems to be broken in Internet Explorer. I'm looking for a fix now.
darkness193 is offline
Country: United Kingdom
 
Old 04-13-2008, 11:14 AM   #46 (permalink)
Junior Member
 
Join Date: Mar 2008
Posts: 29
darkness193
Default Re: Youtube - Fresh new thread...

Ok here's the fix for fullscreen video in IE, the video replace has been moved to postParse so that the embed code isn't edited by the proxy. I've entirely redone the embed code, since alot of what was in there isn't used by the new version of the player.

Code:
<?php
##############################################
# Plugin: YOUTUBE.COM
##############################################

/* ABOUT ---------------------------------
/ This plugin replaces the default YouTube video player
/ with our own player that loads the flv file through
/ the proxy.
-----------------------------------------*/

##########################################
# REMOVE NON-WORKING FLASH OBJECTS
##########################################
$options['stripFlash']=true;

##########################################
# EXTRA PARSING AFTER MAIN PROXY PARSER
##########################################
function postParse($html,$type){

  if($type=='html'&&preg_match('/fullscreenUrl\s\=\s.*video\_id\=(.*)\&.*\&t\=(.*)\&/i',$html,$matches)){
    $thumbid_arr=explode('&',basename($matches[1]));
    $thumbid=array_shift($thumbid_arr);
    $html=preg_replace('#<div id="watch-checker-div">(.*)to.write\("watch-checker-div"\);#is','<embed src="'.optURL.'videoplayer.swf" width="480" height="395" allowscriptaccess="always" allowfullscreen="true" flashvars="height=395&width=480&file='.proxifyURL('http://youtube.com/get_video?video_id='.$matches[1].'&t='.$matches[2]).'&image='.proxifyURL('http://i.ytimg.com/vi/'.$thumbid.'/0.jpg').'&backcolor=0x000000&frontcolor=0xCCCCCC&lightcolor=0x996600&searchbar=false&type=flv" menu="false" />'.'<script type="text/javascript">',$html);

  }

  return $html;
}

?>
darkness193 is offline
Country: United Kingdom
 
Old 04-13-2008, 12:33 PM   #47 (permalink)
Member
 
Join Date: Dec 2007
Posts: 91
Phantom
Default Re: Youtube - Fresh new thread...

HI darkness, Your plugin doesnt work with Encode Page on. In I.e7 and Firefox.
Phantom is offline
Country: Canada
 
Old 04-13-2008, 12:47 PM   #48 (permalink)
Junior Member
 
Join Date: Mar 2008
Posts: 29
darkness193
Default Re: Youtube - Fresh new thread...

Hmm I'll take another look.
darkness193 is offline
Country: United Kingdom
 
Old 04-13-2008, 01:09 PM   #49 (permalink)
Junior Member
 
Join Date: Mar 2008
Posts: 29
darkness193
Default Re: Youtube - Fresh new thread...

Ok well the reason it's not working with page encoding on is because it's looking for the player div after the proxy is done encoding it, so obviously it's not going to get found because the source code is garbled. This is a bit of a problem because the only way to get fullscreen working in IE is to use javascript or the <embed> tag JavaScript can't be used because it needs to be implanted into the page header. The only way to do it therefore is with the embed tag which the proxy attempts to rewrite if it's implanted into the page before or during the main proxy parser which means that it has to be done after the main parser. So the only suggestion(s) I can offer is to add code to force page encoding off for YouTube or scrap fullscreen. I've added some code to force page encoding to be turned off, I thought I might aswell seeing as encoding does mess up some of the display for some of YouTube anyway.
darkness193 is offline
Country: United Kingdom
 
Old 04-13-2008, 01:15 PM   #50 (permalink)
Junior Member
 
Join Date: Mar 2008
Posts: 29
darkness193
Default Re: Youtube - Fresh new thread...

Here's one with encoding set to off for YouTube (fullscreen working):
Code:
<?php
##############################################
# Plugin: YOUTUBE.COM
##############################################

/* ABOUT ---------------------------------
/ This plugin replaces the default YouTube video player
/ with our own player that loads the flv file through
/ the proxy.
-----------------------------------------*/

##########################################
# STOP ENCODING TO PREVENT PROBLEMS
##########################################
$options['encodePage']=false;

##########################################
# REMOVE NON-WORKING FLASH OBJECTS
##########################################
$options['stripFlash']=true;

##########################################
# EXTRA PARSING AFTER MAIN PROXY PARSER
##########################################
function postParse($html,$type){

  if($type=='html'&&preg_match('/fullscreenUrl\s\=\s.*video\_id\=(.*)\&.*\&t\=(.*)\&/i',$html,$matches)){
    $thumbid_arr=explode('&',basename($matches[1]));
    $thumbid=array_shift($thumbid_arr);
    $html=preg_replace('#<div id="watch-checker-div">(.*)to.write\("watch-checker-div"\);#is','<embed src="'.optURL.'videoplayer.swf" width="480" height="395" allowscriptaccess="always" allowfullscreen="true" flashvars="height=395&width=480&file='.proxifyURL('http://youtube.com/get_video?video_id='.$matches[1].'&t='.$matches[2]).'&image='.proxifyURL('http://i.ytimg.com/vi/'.$thumbid.'/0.jpg').'&backcolor=0x000000&frontcolor=0xCCCCCC&lightcolor=0x996600&searchbar=false&type=flv" menu="false" />'.'<script type="text/javascript">',$html);

  }

  return $html;
}

?>
darkness193 is offline
Country: United Kingdom
 
Closed Thread

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 09:24 PM.
© 2006-2010 Glype. All Rights Reserved.