Skip to content
martinkolle edited this page Feb 7, 2012 · 1 revision

It is possible to develop a plugin for the Embed Videos.

How to do this:

  1. Make a new file: website.tld.php. It could be: youtube.com.php
  2. Inside the file add: The first thing is we need to parse the URL to get the ID, because we need to get the video in full size format. And this is in another URL. After we have parsed the URL are we constructing the iframe and returning it to the view. The only thing you should do, is to parse the URL and build it for the IFRAME.

your_website Should be the video website.

Easy to go.

`<?php defined('_JEXEC') or die;

class VombieMusicEmbedVideo{

function your_website($song_url,$params,$type,$width,$height){

	$youtubeId 		= explode("?v=", $song_url);
	$embedYoutubeId = $youtubeId[1];
	$url_video		= "http://youtube.com/embed/".$embedYoutubeId;
	$settings		= "?autoplay=".$params->get('modalAutoPlay')."&hd=".$params->get('modalHd');
					
	$rel 			= "rel=\"{url: '".$url_video.$settings."',handler:'iframe',size:{x:".$width.",y:".$height."}}\"";
	$iframe 		= "<iframe width=\"".$width."\" height=\"".$height."\" src=\"".$url_video."\" frameborder=\"0\" allowfullscreen></iframe>";

	$html = ($type == 'popup') ? $rel : $iframe;

//The return should be the iframe or the rel. return $html; } }//class end ?>`

Clone this wiki locally