| @@ -9,9 +9,9 @@ | ||
| 9 | 9 | |
| 10 | 10 | <div class="wrap"> |
| 11 | 11 | <h2>VdoCipher Options</h2> |
| 12 | 12 | |
| 13 | -<form name="vdoOptionForm" method="post" action="options.php"> | |
| 13 | +<form method="post" action="options.php"> | |
| 14 | 14 | <?php |
| 15 | 15 | settings_fields('vdo_option-group'); |
| 16 | 16 | do_settings_sections('vdo_option-group'); |
| 17 | 17 | ?> |
| @@ -27,9 +27,9 @@ | ||
| 27 | 27 | </tr> |
| 28 | 28 | |
| 29 | 29 | <tr valign="top"> |
| 30 | 30 | <th scope="row">Default Width</th> |
| 31 | - <td><input type="text" id="vdo_default_width" name="vdo_default_width" | |
| 31 | + <td><input type="text" name="vdo_default_width" | |
| 32 | 32 | value="<?php echo esc_attr(get_option('vdo_default_width')); ?>" |
| 33 | 33 | /></td> |
| 34 | 34 | </tr> |
| 35 | 35 | |
| @@ -34,59 +34,45 @@ | ||
| 34 | 34 | </tr> |
| 35 | 35 | |
| 36 | 36 | <tr valign="top"> |
| 37 | 37 | <th scope="row">Default Height</th> |
| 38 | - <td><input type="text" id="vdo_default_height" name="vdo_default_height" | |
| 38 | + <td><input type="text" name="vdo_default_height" | |
| 39 | 39 | value="<?php echo esc_attr(get_option('vdo_default_height')); ?>" |
| 40 | 40 | /></td> |
| 41 | 41 | </tr> |
| 42 | 42 | |
| 43 | 43 | <!-- Version Number --> |
| 44 | - <?php | |
| 45 | - if ((get_option('vdo_embed_version')) == false) { | |
| 46 | - update_option('vdo_embed_version', '1.6.4'); | |
| 47 | - } | |
| 44 | + <?php | |
| 45 | + if ((get_option('vdo_embed_version')) == false) { | |
| 46 | + update_option('vdo_embed_version', '1.5.0'); | |
| 47 | + } | |
| 48 | 48 | ?> |
| 49 | 49 | <tr valign="top"> |
| 50 | 50 | <th scope="row">Player Version</th> |
| 51 | 51 | <td> |
| 52 | - <div style="display: inline-flex"> | |
| 53 | - <select id="vdo_embed_version"> | |
| 52 | + <?php $vdo_embed_version_vars = array('0.5', '1.0.0', '1.1.0', '1.1.3', '1.2.7', '1.3.3', '1.4.5','1.5.0'); ?> | |
| 53 | + <select name="vdo_embed_version" id="vdo_embed_version"> | |
| 54 | 54 | <?php |
| 55 | - $vdo_embed_version_vars = array( | |
| 56 | - '0.5', '1.0.0', '1.1.0', '1.1.3', '1.2.7', '1.3.3', '1.4.5','1.5.0','1.6.4' | |
| 57 | - ); | |
| 58 | - $vdo_embed_version_str = get_option('vdo_embed_version'); | |
| 59 | - foreach ($vdo_embed_version_vars as $vdo_embed_version_var) { | |
| 60 | - if ($vdo_embed_version_str == $vdo_embed_version_var) { | |
| 61 | - $selected = 'selected'; | |
| 62 | - } else { | |
| 63 | - $selected = ''; | |
| 64 | - } | |
| 65 | - switch ($vdo_embed_version_var) { | |
| 66 | - case '0.5': | |
| 67 | - $version_old_new = ' (old player)'; | |
| 68 | - break; | |
| 69 | - case '1.6.4': | |
| 70 | - $version_old_new = ' (newest player)' ; | |
| 71 | - break; | |
| 72 | - default: | |
| 73 | - $version_old_new = ' (new player)'; | |
| 74 | - break; | |
| 75 | - } | |
| 76 | - ?> | |
| 55 | + $vdo_embed_version_str = get_option('vdo_embed_version'); | |
| 56 | + ?> | |
| 57 | + <?php | |
| 58 | + foreach($vdo_embed_version_vars as $vdo_embed_version_var) { | |
| 59 | + if ($vdo_embed_version_str == $vdo_embed_version_var) { | |
| 60 | + $selected = 'selected="selected"'; } | |
| 61 | + else { $selected = ''; } | |
| 62 | + | |
| 63 | + if($vdo_embed_version_var === '0.5') { | |
| 64 | + $version_old_new = ' (old player)' ; } | |
| 65 | + elseif ($vdo_embed_version_var === '1.5.0'){ | |
| 66 | + $version_old_new = ' (newest player)' ; } | |
| 67 | + else { | |
| 68 | + $version_old_new = ' (new player)' ; } | |
| 69 | + ?> | |
| 77 | 70 | <option value="<?php echo $vdo_embed_version_var; ?>" <?php echo $selected; ?> > |
| 78 | 71 | <?php echo $vdo_embed_version_var . $version_old_new ; ?> |
| 79 | 72 | </option> |
| 80 | 73 | <?php } ?> |
| 81 | - <option value="Custom Version"> | |
| 82 | - <?php echo 'Custom Version' ?> | |
| 83 | - </option> | |
| 84 | - </select> | |
| 85 | - <input type="text" name="vdo_embed_version" | |
| 86 | - id="vdo_custom_version" | |
| 87 | - style="margin-left:20px; position: relative; width:120px;" /> | |
| 88 | - </div> | |
| 74 | + </select> | |
| 89 | 75 | <p class="description">It is recommended that you use the latest player version for best video playback.</p> |
| 90 | 76 | </td> |
| 91 | 77 | </tr> |
| 92 | 78 | |
| @@ -91,11 +77,11 @@ | ||
| 91 | 77 | </tr> |
| 92 | 78 | |
| 93 | 79 | <!-- Player Theme Options --> |
| 94 | 80 | <?php |
| 95 | - if ((get_option('vdo_player_theme')) == false) { | |
| 96 | - update_option('vdo_player_theme', '9ae8bbe8dd964ddc9bdb932cca1cb59a'); | |
| 97 | - } | |
| 81 | + if ((get_option('vdo_player_theme')) == false) { | |
| 82 | + update_option('vdo_player_theme','9ae8bbe8dd964ddc9bdb932cca1cb59a'); | |
| 83 | + } | |
| 98 | 84 | ?> |
| 99 | 85 | <tr valign="top"> |
| 100 | 86 | <th scope="row">Player Theme</th> |
| 101 | 87 | <td> |
| @@ -101,82 +87,41 @@ | ||
| 101 | 87 | <td> |
| 102 | 88 | <input type="text" name="vdo_player_theme" |
| 103 | 89 | value="<?php echo esc_attr(get_option('vdo_player_theme')); ?>" max-length = "32" style="width: 320px" |
| 104 | 90 | /> |
| 105 | - <p class="description"> | |
| 106 | - Player theme is not available for old player version(0.5). The default theme will be applied for old player. | |
| 107 | - </p> | |
| 91 | + <p class="description">Player theme is not available for old player version(0.5). The default theme will be applied for old player.</p> | |
| 108 | 92 | </td> |
| 109 | 93 | </tr> |
| 110 | - <!-- Player Theme Options end--> | |
| 111 | 94 | |
| 112 | - <!-- Player Watermark option - Flash/ HTML5 starts --> | |
| 113 | - <tr id="vdo_watermark_html_flash" valign="top"> | |
| 114 | - <th scope="row"> Choice of Watermark </th> | |
| 115 | - <td> | |
| 116 | - <?php | |
| 117 | - if ((get_option(vdo_watermark_flash_html) == 'html5')) { | |
| 118 | - $vdocheckedhtml5 = 'checked'; | |
| 119 | - $vdocheckedflash = ''; | |
| 120 | - } elseif ((get_option(vdo_watermark_flash_html) == 'flash')) { | |
| 121 | - $vdocheckedhtml5 = ''; | |
| 122 | - $vdocheckedflash = 'checked'; | |
| 123 | - } | |
| 124 | - ?> | |
| 125 | - <input type="radio" class="vdo-htmlflash" | |
| 126 | - value="html5" name="vdo_watermark_flash_html" | |
| 127 | - id="vdo_html5" <?php echo $vdocheckedhtml5; ?> > | |
| 128 | - <label for="vdo_html5">HTML5 (Overlay)</label> | |
| 129 | - | |
| 130 | - <input type="radio" class="vdo-htmlflash" | |
| 131 | - value="flash" name="vdo_watermark_flash_html" | |
| 132 | - id="vdo_flash" <?php echo $vdocheckedflash; ?> > | |
| 133 | - <label for="vdo_flash">Flash (Hard-Coded)</label> | |
| 134 | - </td> | |
| 135 | - </tr> | |
| 136 | - <!-- Player Watermark option - Flash/ HTML5 ends --> | |
| 137 | - | |
| 138 | - | |
| 139 | 95 | <tr valign="top"> |
| 140 | 96 | <th scope="row">Annotation Statement</th> |
| 141 | 97 | <td> |
| 142 | 98 | <div style="display: inline-flex;"> |
| 143 | - <textarea name="vdo_annotate_code" id="vdo_watermarkjson" | |
| 144 | - type="textarea" rows="6" cols="55" style="display: float-left" | |
| 145 | - ><?php | |
| 99 | + <textarea name="vdo_annotate_code" id="vdo_watermarkjson" type="textarea" rows="6" cols="55" style="display: float-left"> <?php | |
| 146 | 100 | if (get_option('vdo_annotate_code') != "") { |
| 147 | - echo get_option('vdo_annotate_code'); | |
| 148 | - $vdo_annotation_code = get_option('vdo_annotate_code'); | |
| 149 | - } | |
| 150 | - ?></textarea> | |
| 101 | + echo get_option('vdo_annotate_code'); | |
| 102 | + $vdo_annotation_code = get_option('vdo_annotate_code'); | |
| 103 | + } | |
| 104 | + ?> | |
| 105 | + </textarea> | |
| 151 | 106 | <p class="description" style="margin-left:20px; position: relative"> |
| 152 | 107 | <span style="color:purple"><b>Sample Code for Dynamic Watermark</b></span><br/> |
| 153 | - [{'type':'rtext', 'text':' {name}', 'alpha':'0.60', 'color':'0xFF0000','size':'15','interval':'5000'}] <br/> | |
| 108 | + [{'type':'rtext', 'text':' {name}', 'alpha':'0.60', 'color':'0xFF0000','size':'17','interval':'5000'}] <br/> | |
| 154 | 109 | <span style="color:purple"><b>Sample Code for Static Watermark</b></span><br/> |
| 155 | 110 | [{'type':'text', 'text':'{ip}', 'alpha':'0.5' , 'x':'10', 'y':'100', 'color':'0xFF0000', 'size':'12'}] <br/> |
| 156 | 111 | </p> |
| 157 | 112 | </div> |
| 158 | 113 | <p class="description" id="vdojsonvalidator"></p> |
| 159 | - <p class="description"> | |
| 160 | - Leave this text blank in case you do not need watermark over all | |
| 161 | - videos. For details on writing the annotation code | |
| 162 | - <a href="https://www.vdocipher.com/blog/2014/12/add-text-to-videos-with-watermark/" target="_blank"> | |
| 163 | - check this out | |
| 164 | - </a> | |
| 165 | - </p> | |
| 114 | + <p class="description">Leave this text blank in case you do not need watermark over all videos. For details on writing the annotation code <a href="https://www.vdocipher.com/blog/2014/12/add-text-to-videos-with-watermark/" target="_blank">check this out</a></p> | |
| 166 | 115 | </td> |
| 167 | 116 | </tr> |
| 168 | 117 | </table> |
| 169 | 118 | <?php |
| 170 | - wp_enqueue_script('vdo_validate_watermark', plugin_dir_url(__FILE__).'js/validatewatermark.js'); | |
| 171 | - wp_localize_script('vdo_validate_watermark', 'vdoValidateWatermark', array( | |
| 119 | + wp_enqueue_script('vdo_change_player_version',plugin_dir_url(__FILE__).'js/validatewatermark.js'); | |
| 120 | + wp_localize_script('vdo_change_player_version', 'vdoVersionData', array( | |
| 172 | 121 | 'vdoWatermark' => $vdo_annotation_code |
| 173 | - )); | |
| 174 | - wp_enqueue_script('vdo_html_flash_choice', plugin_dir_url(__FILE__).'js/flashhtml5choice.js'); | |
| 175 | - wp_localize_script('vdo_html_flash_choice', 'vdoVD', array( | |
| 176 | - 'vdoAV' => $vdo_embed_version_vars, | |
| 177 | - 'vdoSV' => $vdo_embed_version_str | |
| 178 | - )); | |
| 122 | + ) | |
| 123 | + ); | |
| 179 | 124 | ?> |
| 180 | 125 | <?php submit_button(); ?> |
| 181 | 126 | </form> |
| 182 | 127 | </div> |