Source for file data.video.php
Documentation is available at data.video.php
* @subpackage plugins_data
define( 'PLUGIN_GUID_DATAVIDEO', 'datavideo' );
'auto_activate' => FALSE,
'requires_pair' => FALSE,
'preload_function' => 'data_video_preload',
'load_function' => 'data_video',
'help_page' => 'DataPluginVideo',
'description' => tra( "This plugin allows you to simply and safely insert a video in a page. Currently it only supports Flash Video (.flv) files." ),
'help_function' => 'data_video_help',
'syntax' => "{video video= player=}",
* @return HTML help in a table
'<table class="data help">'
. '<th>' . tra( "Key" ) . '</th>'
. '<th>' . tra( "Type" ) . '</th>'
. '<th>' . tra( "Comments" ) . '</th>'
. '<td>' . tra( "string" ) . '<br />' . tra("(required)") . '</td>'
. '<td>' . tra( "URL of the video file. E.g. http://example.com/foo.flv" ) . '</td>'
. '<td>' . tra( "sting" ) . '<br />' . tra( "(optional)" ) . '</td>'
. '<td>' . tra( "URL of the player object. E.g. http://example.com/player.swf" ) . '</td>'
. '<td>' . tra( "numeric" ) . '<br />' . tra("(optional)") . '</td>'
. '<td>' . tra( "Alternate height of the video box in pixels." ) . '</td>'
. '<td>' . tra( "numeric" ) . '<br />' . tra( "(optional)" ) . '</td>'
. '<td>' . tra( "Alternate width of the video box in pixels." ) . '</td>'
. tra( "Example: " ) . '{video video=http://example.com/foo.flv player=http://example.com/player.swf width=425 height=355}';
* data_video_preload This function is loaded on every page load before anything happens and is used to load required scripts.
* @return TRUE on success, FALSE on failure - mErrors will contain reason for failure
$gBitThemes->loadJavascript( UTIL_PKG_PATH. "javascript/flv_player/swfobject.js", FALSE, 25 );
* @return TRUE on success, FALSE on failure - mErrors will contain reason for failure
// static var in case multiple videos on one page
$width = ( !empty( $width ) ? $width : "425" );
$height = ( !empty( $height ) ? $height : "355" );
$player = UTIL_PKG_URL. 'javascript/flv_player/mediaplayer.swf';
$playerId = "flv_player_". $playerCount++ ;
$ret = '<div class="video-plugin">
<p id="'. $playerId. '"><a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this video.</p>
<script type="text/javascript"> var so = new SWFObject(\''. $player. '\',\'player\',\''. $width. '\',\''. $height. '\',\'7\'); so.addVariable("file","'. $video. '");so.addVariable("overstretch","fit"); so.addVariable("frontcolor","0xffffff"); so.addVariable("backcolor","0x193d55"); so.write(\''. $playerId. '\');</script>';
|