Keyword

Different dimensions per video

More
16 years 8 months ago #899 by palebluedot
Replied by palebluedot on topic Re: Different dimensions per video
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?

Please Log in or Create an account to join the conversation.

More
16 years 7 months ago #900 by adrianmak
Replied by adrianmak on topic Re: The size

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.

More
16 years 5 months ago #901 by IBRAHIM KHACHAB
Replied by IBRAHIM KHACHAB on topic Re: Different dimensions per video
Hi to you all,

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.

More
16 years 4 months ago #902 by JaiHutcherson
Replied by JaiHutcherson on topic Re: Different dimensions per video
Hey Folks,

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.

More
16 years 4 months ago #903 by hope2
Replied by hope2 on topic Re: Different dimensions per video

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.

More
16 years 4 months ago #904 by wwwcad
Replied by wwwcad on topic Re: Different dimensions per video
Attached is the file updated with the function of ibrahim, Thanks :D!!!
Attachments:

Please Log in or Create an account to join the conversation.

More
16 years 4 months ago #905 by Divit
Replied by Divit on topic Re: Different dimensions per video
Does this only work on {flv} cause I tried to implement it on www.vui.be and nothing changes on the lembeh clip?

Please Log in or Create an account to join the conversation.

More
16 years 3 months ago #906 by nanaya
Replied by nanaya on topic Re: Different dimensions per video
Thank you!!.. That Really Helped ALOT!!!

Please Log in or Create an account to join the conversation.

More
16 years 3 months ago #907 by YvesDL
Replied by YvesDL on topic Re: Different dimensions per video

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
  • Poor Irishman Internet Marketing's Avatar
  • Offline
  • New Member
More
16 years 1 month ago #908 by Poor Irishman Internet Marketing
Replied by Poor Irishman Internet Marketing on topic Re: Different dimensions per video
Ibrahim -

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.


Powered by Kunena Forum