11-08-2006, 07:54 PM
|
|
|
Join Date: Jul 2002
Location: Scotland
Posts: 3,486
Благодарил(а): 0 раз(а)
Поблагодарили:
0 раз(а) в 0 сообщениях
|
|
Quote:
Originally Posted by |oR|Greg
I'm SO close to making Google Video and You Tube videos play within LDM... I just need one last step!!!!
Andrew, I got the IF statement working inside the links_playbit template by adding some more code to the original WIMPY Player plugin that I changed for the FLV Player. Here is the code that I added to the plugin:
PHP Code:
if(stristr($url, 'video.google.com/videoplay?docid=') == TRUE) {
$player = "google";
$google_patterns = array(
'http://video.google.com/videoplay\?docid=(.*?)&(.*?)',
'http://video.google.com/videoplay\?docid=(.*?)',
);
$google_rep = array(
'http://video.google.com/videoplay?docid=$1',
'http://video.google.com/videoplay?docid=$1',
);
$url = preg_replace($google_patterns, $google_rep, $url);
}
if(stristr($url, 'youtube.com/watch?v=') == TRUE) {
$player = "youtube";
$youtube_patterns = array(
'http://www.youtube.com/watch\?v=(.*?)&(.*?)',
'http://www.youtube.com/watch\?v=(.*?)',
'http://youtube.com/watch\?v=(.*?)&(.*?)',
'http://youtube.com/watch\?v=(.*?)',
);
$youtube_rep = array(
'http://www.youtube.com/watch?v=$1',
'http://www.youtube.com/watch?v=$1',
'http://www.youtube.com/watch?v=$1',
'http://www.youtube.com/watch?v=$1',
);
$url = preg_replace($youtube_patterns, $youtube_rep, $url);
}
Now, here is the code I added to the links_playbit:
HTML Code:
<if condition="$player=='youtube'">
<object width="640" height="480" type="application/x-shockwave-flash" data="$url">
<param name="movie" value="$url" />
<param name="wmode" value="transparent" />
<em><strong>ERROR:</strong> If you can see this, then <a href="http://www.youtube.com/">YouTube</a> is down or you don't have Flash installed.</em>
</object>
</if>
<if condition="$player=='google'">
<object width="640" height="480" type="application/x-shockwave-flash" data="$url">
<param name="movie" value="$url" />
<param name="allowScriptAccess" value="sameDomain" />
<param name="quality" value="best" />
<param name="scale" value="noScale" />
<param name="wmode" value="transparent" />
<param name="salign" value="TL" />
<param name="FlashVars" value="playerMode=embedded" />
<em><strong>ERROR:</strong> If you can see this, then <a href="http://video.google.com/">Google Video</a> is down or you don't have Flash installed.</em>
</object>
</if>
There are 2 prolems I think... - When I add a new url entry to LDM like http://www.youtube.com/watch?v=X4ery9QRfpA, it goes OFF-site and opens a new window rather then opening in the same window with an embeded player, all because it's not a local file.
- The jukebox settings require a file type. There is none for this, so I don't know what to do for that either.
Pretty please help me out, I'm SOOO close to embedding these (I think). Aren't you proud of me too, because I wrote my first plugin code?
|
For your second question, edit includes/local_links_include.php, and go to line 2451 (in 2.2.6 rc), which reads
Code:
if (($user_mac or $user_windows) and get_mimetype($urlType) and in_array($urlType, $musicboxtypes)) $is_musicbox = 1;
Try adding something like:
Code:
if(stristr($linkurlurl, 'video.google.com/videoplay?docid=')) $is_musicbox = 1;
|