• This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

[Add More Video Sites] BB Code Media

I'll see what I do later tonight after dinner with it.

.... and a big *NSFW* warning for anybody who might be clicking on that example link above.
 
I have removed all references and links to the website.

Content such as that is completely unsuitable for this forum, please do not post any more links to it.
 
I have removed all references and links to the website.

Content such as that is completely unsuitable for this forum, please do not post any more links to it.
Wouldn't it have made more sense to remove the ID part of the link rather than the whole lot? Why remove the code part, it didn't link to anything.

I'm going to find a SFW link from the same site and use that as an example, I hope you don't delete that.
 
The whole site is unsuitable, please do not post any more links from it as they will be deleted.
With all due respect you're being very unreasonable, the second post of this thread links to a site that shows beheading videos and porn.

I'll not post an example link and will instead just post the structure and will even mark that as NSFW.
 
NSFW NSFW NSFW NSFW NSFW NSFW

Okay.

So I've removed the offending links.

Where you see "REMOVEDFORBROGAN" replace that with "theync" :D

Example link http://REMOVEDFORBROGAN.com/media.php?name=23346-taliban

Match URL would go like this http://REMOVEDFORBROGAN.com/media.php?name={$id} I believe.

Now here the interesting part, the admin at The YNC forums posts these video's to his forum as well, below is what I grabbed from what he posted. The only thing changed is that I've added {$id} to the end of the linking part found after name= in the example URL. Tried playing about with this last night but no joy.
Code:
<div id='player'></div><script type='text/javascript'>var so = new SWFObject('http://www.REMOVEDFORBROGAN.com/flvplayer.swf','mpl','450','360','8'); so.addParam('allowscriptaccess','always'); so.addParam('allowfullscreen','true'); so.addVariable('height','360'); so.addVariable('width','450'); so.addVariable('file','http://www.REMOVEDFORBROGAN.com/videos/{$ID}.flv'); so.addVariable('lightcolor','0xAAAAAA'); so.addVariable('screencolor','0x888888'); so.addVariable('autostart','false'); so.write('player');</script>[code]

NSFW NSFW NSFW NSFW NSFW NSFW
 
BBC iPlayer

Match url:

Code:
http://www.bbc.co.uk/iplayer/playlist/{$id}

Embed html:

Code:
<object width="610" height="480"><param name="movie" value="http://www.bbc.co.uk/emp/external/player.swf"></param><param name="allowFullScreen" value="true"></param><param name="allowScriptAccess" value="always"></param><param name="FlashVars" value="playlist=http%3A%2F%2Fwww%2Ebbc%2Eco%2Euk%2Fiplayer%2Fplaylist%2F{$id}&config=undefined&config_settings_skin=black&config_settings_suppressRelatedLinks=true&config_settings_showFooter=true&"></param><embed src="http://www.bbc.co.uk/emp/external/player.swf" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="610" height="480" FlashVars="playlist=http%3A%2F%2Fwww%2Ebbc%2Eco%2Euk%2Fiplayer%2Fplaylist%2F{$id}&config=undefined&config_settings_skin=black&config_settings_suppressRelatedLinks=true&config_settings_showFooter=true&"></embed></object>

:)
 
AOL Video


Match url:

Code:
http://video.aol.com/aolvideo/aol-television/*/{$id}

Embed html:

Code:
<object width="600" height="338" id="AOLVP_{$id}" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"><param name="movie" value="http://o.aolcdn.com/videoplayer/AOL_PlayerLoader.swf"></param><param name="bgcolor" value="#000000"></param><param name="allowFullScreen" value="true"></param><param name="wmode" value="transparent"/><param name="allowscriptaccess" value="always"></param><param name="flashvars" value="codever=1&videoid={$id}&playerid=61371447001&publisherid=1612833736&stillurl=http%3A%2F%2Fpdl%2Estream%2Eaol%2Ecom%2Fpdlext%2Faol%2Fbrightcove%2Faolmaster%2F1612833736%2F1612833736%5F{$id}%5Fari%2Dorigin54%2Darc%2D153%2D1317260255660%2Ejpg%3FpubId%3D1612833736"></param><embed src="http://o.aolcdn.com/videoplayer/AOL_PlayerLoader.swf" type="application/x-shockwave-flash" allowscriptaccess="always" wmode="transparent" allowfullscreen="true" bgcolor="#000000" width="600" height="338" name="AOLVP_{$id}" flashvars="codever=1&videoid={$id}&playerid=61371447001&publisherid=1612833736&stillurl=http%3A%2F%2Fpdl%2Estream%2Eaol%2Ecom%2Fpdlext%2Faol%2Fbrightcove%2Faolmaster%2F1612833736%2F1612833736%5F{$id}%5Fari%2Dorigin54%2Darc%2D153%2D1317260255660%2Ejpg%3FpubId%3D1612833736"></embed></object>

:)
 
Soundcloud and Ustream possible with 1.1 ?

Example URLs

http://soundcloud.com/*
http://soundcloud.com/*/*
http://soundcloud.com/*/sets/*
http://soundcloud.com/groups/*
http://snd.sc/*

http://www.ustream.tv/recorded/*
http://www.ustream.tv/channel/*
http://www.ustream.tv/*
 
Yahoo Vids
__________________

Media Site ID:
Code:
yahoo

Site Title:
Code:
Yahoo

Site URL:
Code:
http://www.yahoo.com
View attachment 15565
Match URLs:
Code:
http://*video.yahoo.com/*/*/*-{$id}.html
http://*.yahoo.com/?vid={$id}

Embed Html:
Code:
<object width="576" height="324">
<param name="movie" value="http://d.yimg.com/nl/vyc/site/player.swf"></param>
<param name="flashVars" value="vid={$id}&lang=en-US&"></param>
<param name="allowfullscreen" value="true"></param>
<param name="wmode" value="transparent"></param>
<embed width="576" height="324" allowFullScreen="true" src="http://d.yimg.com/nl/vyc/site/player.swf" type="application/x-shockwave-flash" flashvars="vid={$id}&lang=en-US&"></embed></object>

DId not work for Yahoo News. Do you have the code for Yahoo News?

http://news.yahoo.com/video/us-1574...parents-after-garinger-shooting-26851776.html
 
Soundcloud and Ustream possible with 1.1 ?

I got soundcloud working with 1.1:

Admin CP -> Home -> BB Code Media Sites -> Add BB Code Media Site

Media Site ID: soundcloud

Site Title: SoundCloud

Site URL: http://soundcloud.com/

Match URLs: #http://soundcloud\.com/(?P<id>[\-a-z0-9_]+/[\-a-z0-9_]+)$#siU

Embed HTML:

Code:
<object height="81" width="100%">
<param name="movie" value="http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fsoundcloud.com%2F{$id}&amp;g=bb"></param>
<param name="allowscriptaccess" value="always"></param>
<embed allowscriptaccess="always" height="81" src="http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fsoundcloud.com%2F{$id}&amp;g=bb" type="application/x-shockwave-flash" width="100%"></embed>
</object>

And be sure to enable Use 'Match URLs' as PCRE regular expressions under Advanced Options.

URLs tested:
http://soundcloud.com/chimpstudio/tes-27-apr
http://soundcloud.com/chimpstudio/acid-drinkers-ania-brachaczek-love-shack-jacek-mix1
 
In honor of my last thread about soundcloud embedding that got a bbcode created in less than an hour, can we possibly embed grooveshark playlists? This would make music sections of sites absolutely fantastic!!!
 
I've merged your thread with this one, which is where requests of this nature are usually posted.
 
In honor of my last thread about soundcloud embedding that got a bbcode created in less than an hour, can we possibly embed grooveshark playlists? This would make music sections of sites absolutely fantastic!!!

I had a thorough look at GrooveShark and was unable to get it working. The embed code uses an id which is not present in either the URL or in the page source, so you can't even scrape the web page.
 

This one was difficult but I got it working. You need to use some callbacks:

Admin CP -> Home -> BB Code Media Sites -> Add BB Code Media Site

Media Site ID: mitworld

Site Title: MIT World

Site URL: http://mitworld.mit.edu/

Match URLs: http://mitworld.mit.edu/video/{$id}

Embed HTML:

Code:
<see html callback>

Then under Advanced Options:

URL Match Callback: MediaSites_MITWorld::extractParams

Embed HTML Callback: MediaSites_MITWorld::buildEmbed

And you need to create the following directory/file (also attached to this post):

library/MediaSites/MITWorld.php

Code:
<?php

class MediaSites_MITWorld
{
	public static function extractParams($url, $matchedId, array $site)
	{
		// CAPTURE WEB PAGE
		$pageHtml = file_get_contents('http://mitworld.mit.edu/video/' . $matchedId);

		// ISOLATE THE EMBED CODE FROM THE PAGE SOURCE
		if(preg_match("/[^\w]shareCode:'(?P<embedhtml>[^']+)'/siU", $pageHtml, $match))
		{
			// FROM EMBED CODE, ISOLATE THE MEDIAKEY AND PREVIEWIMAGE
			if(preg_match('#param name="movie" value="[^&]+&flv=(?P<mediakey>[^&]+)&preview=http://mitworld\.mit\.edu//uploads/(?P<previewimage>[^"]+)"#si', $match['embedhtml'], $info))
			{
				// RETURN DELIMITED MEDIAKEY AND PREVIEWIMAGE
				// THESE TWO VALUES ARE INSERTED INTO THE HTML IN THE HTML CALLBACK
				return $info['mediakey'] . '|' . $info['previewimage'];
			}
		}

		// RETURN NOTHING IF NO MATCH
		return '';
	}

	public static function buildEmbed($mediaKey, array $site)
	{
		// EXTRACT MEDIAKEY AND PREVIEWIMAGE USING DELIMITER
		$delimiter = strpos($mediaKey, '|');
		$components['mediakey'] = substr($mediaKey, 0, $delimiter);
		$components['previewimage'] = substr($mediaKey, $delimiter + 1);

		// DEFINE GENERIC EMBED HTML WITH REPLACEMENT VARIABLES, __MEDIAKEY__ AND __PREVIEWIMAGE__
		$embedHtml = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="481" height="271" id="Main" align="middle">
<param name="allowScriptAccess" value="always" />
<param name="movie" value="http://mitworld.mit.edu/flash/player/Main.swf?host=cp58255.edgefcs.net&flv=__MEDIAKEY__&preview=http://mitworld.mit.edu//uploads/__PREVIEWIMAGE__" />
<param name="quality" value="high" />
<param name="bgcolor" value="#000000" />
<embed src="http://mitworld.mit.edu/flash/player/Main.swf?host=cp58255.edgefcs.net&flv=__MEDIAKEY__&preview=http://mitworld.mit.edu//uploads/__PREVIEWIMAGE__" quality="high" bgcolor="#000000" width="481" height="271" name="Main" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>';

		// MAKE THE REPLACEMENTS
		$finalHtml = str_replace(array('__MEDIAKEY__', '__PREVIEWIMAGE__'), array($components['mediakey'], $components['previewimage']), $embedHtml);

		// RETURN THE FINISHED HTML
		return $finalHtml;
	}
}

URLs tested:
http://mitworld.mit.edu/video/931
http://mitworld.mit.edu/video/934
http://mitworld.mit.edu/video/923
 

Attachments

Top Bottom