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