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: 6227
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.
- palebluedot
-
- Offline
- New Member
- Posts: 3
forum.joomlaworks.net/index.php?topic=383.msg1157#msg1157
When you combine these two fixes the image attribute does not show up in the resulting code. Would anyone have a way around this to add it back in?
Please Log in or Create an account to join the conversation.
- adrianmak
-
- Offline
- New Member
- Posts: 1
Hi, I had the same problem and I resolved it by modifying the file plugin_jw_allvideos.php under /mambots/content adding this function:
// 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
I prefer the format as follow
{XXX}video|320|240{/XXX}
If no specified, the size will be use by default configured in mambot settings.
Please Log in or Create an account to join the conversation.
- IBRAHIM KHACHAB
-
- Offline
- New Member
- Posts: 2
I'm using this plugin from two days and I shall say it is a great one!
I was wondering if it was possible to specify the width and thw height for every single video and I found this post. I read this post and I shall say that I also prefer something like {XXX}video|320|240{/XXX}.
I looked in the code of the plugin and I created a little function that I called "getWidthHeight" that shall be called this way
getWidthHeight($published, $row, $param, $page);
after the line
$param =& new mosParameters( $mambot->params );
of every function in the code.
and this works if you specify the width and the height as for example {flv}video|500|375{/flv}.
Here is the function
function getWidthHeight($published, &$row, &$param, $page=0 ) {
if (preg_match_all("#{.+?}(.*?){/.+?}#s", $row->text, $matches, PREG_PATTERN_ORDER) > 0) {
foreach ($matches[0] as $match) {
$match = preg_replace("/{.+?}/", "", $match);
$video_info = explode('|',$match);
if (is_array($video_info)){
$video_name =$video_info[0];
$param->set('width',$video_info[1]);
$param->set('height',$video_info[2]);
$row->text = str_replace($match, $video_name, $row->text);
}
}
}
}
I hope this can help.
Ibrahim
Please Log in or Create an account to join the conversation.
- JaiHutcherson
-
- Offline
- New Member
- Posts: 1
First Great Stuff!!!
OK, for a complete newbie here, Where do I put that code? I know my way around php a bit, can manage to do any of this, just dont know where to put it. Any help would be great!!!
Thanks for your time and effort,
Jai
Please Log in or Create an account to join the conversation.
- hope2
-
- Offline
- New Member
- Posts: 1
Thanks much for this. I do have a conflict with this other fix I want to implement (Start Image Fix)
forum.joomlaworks.net/index.php?topic=383.msg1157#msg1157
When you combine these two fixes the image attribute does not show up in the resulting code. Would anyone have a way around this to add it back in?
Does anybody solve the conflict with this ?
I have try the second function ibrahim suggests but it seems that the image hasnt the right allign . Is has right allign I think :( .
So any solution please?
Thanks
Please Log in or Create an account to join the conversation.
- wwwcad
-
- Offline
- New Member
Please Log in or Create an account to join the conversation.
- Divit
-
- Offline
- New Member
- Posts: 1
Please Log in or Create an account to join the conversation.
- nanaya
-
- Offline
- New Member
- Posts: 3
Please Log in or Create an account to join the conversation.
- YvesDL
-
- Offline
- New Member
- Posts: 1
Thanks much for this. I do have a conflict with this other fix I want to implement (Start Image Fix)
forum.joomlaworks.net/index.php?topic=383.msg1157#msg1157
When you combine these two fixes the image attribute does not show up in the resulting code. Would anyone have a way around this to add it back in?
Same problem here.
Please Log in or Create an account to join the conversation.
- Poor Irishman Internet Marketing
-
- Offline
- New Member
- Posts: 4
Thank You! Your solution works perfectly -
and it works with the Preview Image for FLV installed!
Way to go - great code all! Thanks!
Please Log in or Create an account to join the conversation.