These are the codes I put in my play.php file used to implement the video display function with pligg. Aside from the youtube and google video links, I added also the possibility to add videos from myspace and zappinternet (spanish). I still have a problem to find the right coding to Dailymotion - Share Your Videos, the way the link their url to their swf player is a bit different, so if somebody has got dailymotion working in its videodisplay function, tell us what the right code is.
SO here's my code in play.php... all of them are working ! But I cannot fix dailymotion... please, if somebody knows..
--------------------------
Code:
function embed_video($url){
if (preg_match("/http:\/\/video.google.com\/videoplay\?docid=([0-9\-]*)(.*)/i", $url, $matches)) {
return '<object width="400" height="326">'.
'<embed src="http://video.google.com/googleplayer.swf?docId='.$matches[1].'" type="application/x-shockwave-flash" width="400" height="326" />'.
'</object>';
}
if (preg_match("/http:\/\/video.google.es\/videoplay\?docid=([0-9\-]*)(.*)/i", $url, $matches)) {
return '<object width="400" height="326">'.
'<embed src="http://video.google.es/googleplayer.swf?docId='.$matches[1].'" type="application/x-shockwave-flash" width="400" height="326" />'.
'</object>';
}
if (preg_match("/http:\/\/www.youtube.com\/watch\?v=([0-9a-zA-Z\-\_]*)(.*)/i", $url, $matches)) {
return '<object width="425" height="350">'.
'<param name="movie" value="http://www.youtube.com/v/'.$matches[1].'" />'.
'<param name="wmode" value="transparent" />'.
'<embed src="http://www.youtube.com/v/'.$matches[1].'&autoplay=1" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350" />'.
'</object>';
}
if (preg_match("/http:\/\/www.youtube.es\/watch\?v=([0-9a-zA-Z\-\_]*)(.*)/i", $url, $matches)) {
return '<object width="425" height="350">'.
'<param name="movie" value="http://www.youtube.es/v/'.$matches[1].'" />'.
'<param name="wmode" value="transparent" />'.
'<embed src="http://www.youtube.es/v/'.$matches[1].'&autoplay=1" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350" />'.
'</object>';
}
if (preg_match("/http:\/\/es.youtube.com\/watch\?v=([0-9a-zA-Z\-\_]*)(.*)/i", $url, $matches)) {
return '<object width="425" height="350">'.
'<param name="movie" value="http://es.youtube.com/v/'.$matches[1].'" />'.
'<param name="wmode" value="transparent" />'.
'<embed src="http://www.youtube.com/v/'.$matches[1].'&autoplay=1" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350" />'.
'</object>';
}
if (preg_match("/http:\/\/vids.myspace.com\/index.cfm\?fuseaction=vids.individual&videoid=([0-9a-zA-Z\-\_]*)(.*)/i", $url, $matches)) {
return '<object width="430" height="346">'.
'<embed src="http://lads.myspace.com/videos/vplayer.swf?m='.$matches[1].'" type="application/x-shockwave-flash" width="430" height="346">'.
'</object>';
}
if (preg_match("/http:\/\/www.zappinternet.com\/video\/([0-9a-zA-Z\-\_]*)(.*)/i", $url, $matches)) {
return '<object width="430" height="345">'.
'<embed style="width:430px; height:345px;" id="VideoZappInternet" type="application/x-shockwave-flash" src="http://zappinternet.com/flash/zappplayer.swf?embed=true&idvideo='.$matches[1].'">'.
'</object>';
}
return '';
}








Linear Mode
