COMMUNITY FORUM
Different dimensions per video
- amorino
- Topic Author
- Offline
- New Member
Can i fix the size of the video individually.
I want (for example) to have 2 videos on the same page one 300x400 in the center and one other 180x150 on the left position
is it possible?
Thank you
Please Log in or Create an account to join the conversation.
- JoomlaWorks
- Offline
- Admin
- Posts: 6211
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- amorino
- Topic Author
- Offline
- New Member
Please Log in or Create an account to join the conversation.
- zoroox
- Offline
- New Member
- Posts: 7
We wait for this feature for March as you said in joomla site.
At least I hope it will release that wonderfull mambot with no bugs and well tested !
Please Log in or Create an account to join the conversation.
- zoroox
- Offline
- New Member
- Posts: 7
Please Log in or Create an account to join the conversation.
- amorino
- Topic Author
- Offline
- New Member
Please Log in or Create an account to join the conversation.
- lucs
- Offline
- New Member
- Posts: 2
// Group Zero (personal size for local flv videos) eg: {flv-widthxheight}video_flv{/flv}
$_MAMBOTS->registerFunction( 'onPrepareContent', 'AllVideos_personal' );
function AllVideos_personal( $published, &$row, &$params, $page=0 ) {
// add parameters
global $mosConfig_absolute_path, $mosConfig_live_site, $mosConfig_session_type, $mainframe, $database;
$query = "SELECT id FROM #__mambots WHERE element = 'plugin_jw_allvideos' AND folder = 'content'";
$database->setQuery( $query );
$id = $database->loadResult();
$mambot = new mosMambot( $database );
$mambot->load( $id );
$param =& new mosParameters( $mambot->params );
$allvideos_css = $param->get('allvideos_css', 'allvideos');
$top_margin = 'margin-top:'.$param->get('top_margin', 8).'px;';
$bottom_margin = 'margin-bottom:'.$param->get('bottom_margin', 8).'px;';
$video_align = 'text-align:'.$param->get('video_align', 'left').';';
$video_folder = $param->get('video_folder', 'images/stories/videos/');
$video_transparency = $param->get('video_transparency', 'transparent');
$video_bg = $param->get('video_bg', '');
$autostart = '&'.$param->get('autostart', 'autostart=false');
$audio_folder = $param->get('audio_folder', 'images/stories/audio/');
// end parameters
$out = "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\" style=\"***misure***\" title=\"AllVideos Player\">
<param name=\"movie\" value=\"$mosConfig_live_site/mambots/content/plugin_jw_allvideos/jw_allvideos_player.swf?file=$mosConfig_live_site/".$video_folder."***video***.flv&showdigits=true".$autostart."\" />
<param name=\"quality\" value=\"high\" />
<param name=\"wmode\" value=\"".$video_transparency."\" />
<param name=\"bgcolor\" value=\"".$video_bg."\">
<embed src=\"$mosConfig_live_site/mambots/content/plugin_jw_allvideos/jw_allvideos_player.swf?file=$mosConfig_live_site/".$video_folder."***video***.flv&showdigits=true".$autostart."\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" wmode=\"".$video_transparency."\" bgcolor=\"".$video_bg."\" style=\"***misure***\"></embed>
</object>";
$regexp = "#{flv-(.*?)}(.*?){/flv}#s";
// prepend and append code
$startcode = "\n\n<!-- JW AllVideos Plugin (v2.4) starts here -->\n<div style=\"clear:both;".$video_align.$top_margin.$bottom_margin."\" class=\"".$allvideos_css."\">\n";
$endcode = "\n</div>\n<!-- JW AllVideos Plugin (v2.4) ends here -->\n\n";
if ( !$published ) {
$row->text = preg_replace( $regexp, '', $row->text );
return;
}
if(preg_match_all($regexp, $row->text, $output, PREG_PATTERN_ORDER) > 0){
print_r($output);
for($i=0;$i<count($output[0]);$i++){
$match = preg_replace("/{.+?}/", "", $output[0][$i]);
$misure = explode("x", $output[1][$i]);
$misure_player = 'width:'.$misure[0].'px; height:'.$misure[1].'px;';
$code = str_replace("***misure***", $misure_player, $out);
$code = str_replace("***video***", $match, $code);
$row->text = preg_replace("#{flv-(.*?)}".preg_quote($match)."{/flv}#s", $startcode.$code.$endcode , $row->text );
}
}
}
It's not very flexible and works only with local flv files, but you can spcify your desired size for each flv file.
Syntax is:
{flv-widthxheight}flv-video{/flv}
e.g. {flv-320x240}video{/flv}
I hope it could be of some help.
Luca
Please Log in or Create an account to join the conversation.
- Zappu
- Offline
- New Member
// print_r($output);
as the array printed within the page does not look so fine :)
nice work and just helped me a lot
Zappu
Zappu<br /> MTW Office
Please Log in or Create an account to join the conversation.
- pjburnhill
- Offline
- New Member
- Posts: 2
Please Log in or Create an account to join the conversation.
- lucs
- Offline
- New Member
- Posts: 2
Works fine Lucs as long as you do this:
// print_r($output);
as the array printed within the page does not look so fine :)
nice work and just helped me a lot
Zappu
Ooooops...you're right!! It was only a debug print.
I forgot to comment out that line :-[
Please Log in or Create an account to join the conversation.