Commit c2357e4871841f2e1427f03b1881d7f1bb09f84a

support for todou.com
  
5555 $myspace=new Myspace();
5656 $output = $myspace->myspace_html($url,$options);
5757 break;
58
5859 case 'guba':
5960 include_once('guba.inc');
6061 $guba=new guba();
6162 $output= $guba->guba_html($url,$options);
6263 break;
64 case 'tudou':
65 include_once('todou.inc');
66 $todou=new todou();
67 $output= $todou->todou_html($url,$options);
68 break;
69
70
6371
72
6473 default:
6574 show_error('Unsupported Video provider');
6675 }
101101 }
102102
103103 $host_name = explode('.', $url_info['host']);
104 $url_info['provider'] = ($host_name[0] !== 'www') ? $host_name[0] : $host_name[1];
104 $url_info['provider'] = ($host_name[0] !== 'www') ? $host_name[0]: $host_name[1];
105105 return $url_info;
106106 }
107107}
  
1<?php
2class todou {
3
4 /*
5 * constructor
6 */
7 function todou() {
8 }
9
10 /*
11 * @return
12 * html to render guba videos
13 * @url
14 * string url to video
15 * @options
16 * array containing video height, width, autoplay etc
17 */
18 function todou_html(&$url, $options = array()) {
19 //http://www.tudou.com/programs/view/Z36IUvNCZ9o to http://www.tudou.com/player/outside/player_outside.swf?iid=31494340&default_skin=http://js.tudouui.com/bin/player2/outside/Skin_outside_17.swf&autostart=false&rurl=
20 $url1=explode('/',$url);
21 $url="http://www.tudou.com/player/outside/player_outside.swf?iid=".$url1[5]."&default_skin=http://js.tudouui.com/bin/player2/outside/Skin_outside_17.swf&autostart=false&rurl=";
22
23
24 $div_id = isset($options['div_id']) ? $options['div_id'] : 'guba';
25 $height = isset($options['height']) ? $options['height'] : '300';
26 $width = isset($options['width']) ? $options['width'] : '350';
27 $id = isset($options['id']) ? $options['id'] : 'youtube';
28 $fullscreen_value = isset($options['fullscreen']) ? $options['fullscreen'] : "false" ;
29
30 $output = <<<FLASH
31 <div id="$div_id">
32 <object width="$width" height="$height">
33 <param name="movie" value="$url"></param>
34 <param name="allowFullScreen" value="true"></param>
35 <param name="allowscriptaccess" value="always"></param>
36 <embed src="$url" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed>
37 </object>
38 </div>
39FLASH;
40 return $output;
41 }
42}