SimplePortal

Customization => Blocks and Modifications => Block Requests => Topic started by: dabeer on February 23, 2009, 02:16:46 PM

Title: Video block
Post by: dabeer on February 23, 2009, 02:16:46 PM
I am using Auto Embed Video/Audio Clips mod in my forum and I'd like to suggest exploring this feature in a Video Block, which would display a random video from a predefined "playlist".

The playlist would consist of links to videos in youtube or any other services supported by AEVAC and chosen by administrator.

The block would simply choose a random line from the playlist and display a video, which would give us a "video of the moment" effect in the block.

Is it doable?




Title: Re: Video block
Post by: Old Fossil on April 20, 2009, 03:14:00 AM
I would also like to know if this is possible.
Title: Re: YouTube Block
Post by: Raji on May 04, 2009, 01:51:15 AM
I would like to suggest a youtube block in this portal.
Title: Re: Video block
Post by: Nathaniel on May 04, 2009, 01:54:42 AM
Random Youtube video embeding is easy to do with a PHP block, just go to the youtube video and copy the 'URL' for embeding, then put a list into the array within the code below:

Use this code in a custom PHP block.
Code: [Select]
$urls = array(
   '',
   '',
   '',
);

$rand = rand(0, count($urls) - 1);

echo '<object width="560" height="340"><param name="movie" value="', $urls[$rand], '"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="', $urls[$rand], '" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="560" height="340"></embed></object>';

The list will look like:
Code: [Select]
$urls = array(
   'url1',
   'url2',
   'url3',
   'url4',
);
Title: Re: Video block
Post by: [SiNaN] on May 04, 2009, 02:09:57 AM
You forgot to change the movie parameter. ;)
Title: Re: Video block
Post by: Nathaniel on May 04, 2009, 02:34:44 AM
True. Thanks sinan. :)

Updated the code in the post above.
Title: Re: Video block
Post by: Raji on May 16, 2009, 10:01:18 AM
I have added this code in PHP block but its showing nothing means just a blank screen
Quote
$urls = array(
   'http://www.youtube.com/watch?v=xxYkK9o6UEo',
   'http://www.youtube.com/watch?v=hNzHTCa998w',
   'http://www.youtube.com/watch?v=w0Oh9uKB-fU',
   'http://www.youtube.com/watch?v=3BQ4DiobIQk&feature=channel_page',

);

$rand = rand(0, count($urls) - 1);

echo '<object width="560" height="340">
<param name="movie" value="', $urls[$rand], '"></param>
<param name="allowFullScreen" value="true"></param>
<param name="allowscriptaccess" value="always"></param>
<embed src="', $urls[$rand], '" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="560" height="340"></embed></object>';
Title: Re: Video block
Post by: Old Fossil on May 17, 2009, 12:37:17 AM
If you look at the portal on the forum in the signature then you will see a youtube video.

This was done by using a bbcode block.
SimplePortal 2.3.8 © 2008-2024, SimplePortal