Skip to content

Instantly share code, notes, and snippets.

@todeveni
Created October 26, 2011 18:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save todeveni/1317168 to your computer and use it in GitHub Desktop.
Save todeveni/1317168 to your computer and use it in GitHub Desktop.
Add support for customizable path for jw-flv-player
--- vipers-video-quicktags.php.orig 2011-10-26 20:50:22.888985286 +0300
+++ vipers-video-quicktags.php 2011-10-26 20:57:19.108974647 +0300
@@ -213,6 +213,7 @@
'width' => 400,
'height' => 320,
'skin' => '',
+ 'player' => plugins_url('/vipers-video-quicktags/resources/jw-flv-player/player.swf'),
'customcolors' => 0,
'backcolor' => '#FFFFFF',
'frontcolor' => '#000000',
@@ -1039,6 +1040,7 @@
$usersettings['flv']['width'] = (int) $_POST['vvq-flv-width'];
$usersettings['flv']['height'] = (int) $_POST['vvq-flv-height'];
$usersettings['flv']['skin'] = $_POST['vvq-flv-skin'];
+ $usersettings['flv']['player'] = $_POST['vvq-flv-player'];
$usersettings['flv']['customcolors'] = (int) $_POST['vvq-flv-customcolors'];
$usersettings['flv']['backcolor'] = strtoupper( trim( $_POST['vvq-flv-backcolor'] ) );
$usersettings['flv']['frontcolor'] = strtoupper( trim( $_POST['vvq-flv-frontcolor'] ) );
@@ -1051,6 +1053,7 @@
if ( empty($usersettings['flv']['width']) ) $usersettings['flv']['width'] = $this->defaultsettings['flv']['width'];
if ( empty($usersettings['flv']['height']) ) $usersettings['flv']['height'] = $this->defaultsettings['flv']['height'];
if ( empty($usersettings['flv']['skin']) ) $usersettings['flv']['skin'] = $this->defaultsettings['flv']['skin'];
+ if ( empty($usersettings['flv']['player']) ) $usersettings['flv']['player'] = $this->defaultsettings['flv']['player'];
if ( empty($usersettings['flv']['backcolor']) ) $usersettings['flv']['backcolor'] = $this->defaultsettings['flv']['backcolor'];
if ( empty($usersettings['flv']['frontcolor']) ) $usersettings['flv']['frontcolor'] = $this->defaultsettings['flv']['frontcolor'];
if ( empty($usersettings['flv']['lightcolor']) ) $usersettings['flv']['lightcolor'] = $this->defaultsettings['flv']['lightcolor'];
@@ -1873,7 +1876,7 @@
?>
swfobject.embedSWF(
- "<?php echo plugins_url('/vipers-video-quicktags/resources/jw-flv-player/player.swf'); ?>",
+ "<?php echo $this->settings['flv']['player']; ?>",
"vvqvideopreview",
jQuery("#vvq-width").val(),
jQuery("#vvq-height").val(),
@@ -1944,6 +1947,12 @@
</td>
</tr>
<tr valign="top">
+ <th scope="row"><label for="vvq-flv-player"><?php _e('Path to player', 'vipers-video-quicktags'); ?></label></th>
+ <td>
+ <input type="text" name="vvq-flv-player" id="vvq-flv-player" value="<?php echo esc_attr($this->settings['flv']['player']); ?>" size="50" class="vvqwide" /><br />
+ </td>
+ </tr>
+ <tr valign="top">
<th scope="row"><label for="vvq-flv-customcolors"><?php _e('Use Custom Colors', 'vipers-video-quicktags'); ?></label></th>
<td>
<label><input type="checkbox" name="vvq-flv-customcolors" id="vvq-flv-customcolors" value="1"<?php checked($this->settings['flv']['customcolors'], 1); ?> /></label>
@@ -3497,7 +3506,7 @@
$objectid = $this->videoid('flv');
- $swfurl = plugins_url('/vipers-video-quicktags/resources/jw-flv-player/player.swf');
+ $swfurl = $this->settings['flv']['player'];
$this->swfobjects[$objectid] = array( 'width' => $atts['width'], 'height' => $atts['height'], 'url' => $swfurl, 'flashvars' => $flashvars );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment