PluginProbe
VdoCipher: Secure Video Player and Hosting / 1.17
VdoCipher: Secure Video Player and Hosting v1.17
trunk 1.10 1.11 1.12 1.13 1.14 1.15 1.17 1.18 1.19 1.20 1.21 1.22 1.23 1.24 1.25 1.26 1.27 1.28 1.29 1.3 1.30 1.4 1.5 1.6 All 28 releases
← All changes | vdocipher.php +16 -71 1.211.17 View file →
@@ -2,9 +2,9 @@
2 2 /**
3 3 * Plugin Name: VdoCipher
4 4 * Plugin URI: http://www.vdocipher.com
5 5 * Description: Secured video hosting for wordpress
6 - * Version: 1.21
6 + * Version: 1.17
7 7 * Author: VdoCipher
8 8 * Author URI: http://www.vdocipher.com
9 9 * License: GPL2
10 10 */
@@ -46,15 +46,11 @@
46 46 'height' => get_option('vdo_default_height') . "px",
47 47 'id' => 'id',
48 48 'no_annotate'=> false,
49 49 'version'=> 0,
50 - 'player_tech'=> ''
51 50 ),
52 51 $atts
53 52 ));
54 - if ((get_option('vdo_default_height')) == 'auto') {
55 - $height = 'auto';
56 - }
57 53 if (!$atts['id']) {
58 54 if (!$atts['title']) {
59 55 return "Required argument id for embedded video not found.";
60 56 }
@@ -118,44 +114,22 @@
118 114 if (isset($atts['version'])) {
119 115 $version = $atts['version'];
120 116 }
121 117 if ((get_option('vdo_embed_version')) == false) {
122 - update_option('vdo_embed_version', '1.6.4');
118 + update_option('vdo_embed_version', '0.5');
123 119 }
124 120 if ((get_option('vdo_player_theme')) == false) {
125 - update_option('vdo_player_theme', '9ae8bbe8dd964ddc9bdb932cca1cb59a');
121 + update_option('vdo_player_theme','9ae8bbe8dd964ddc9bdb932cca1cb59a');
126 122 }
127 123 $vdo_embed_version_str = get_option('vdo_embed_version');
128 124 $vdo_player_theme = get_option('vdo_player_theme');
129 125
130 - // tech override custom names start
131 - switch ($player_tech) {
132 - case "flash":
133 - $player_tech = "*,-dash";
134 - break;
135 - case "nohtml5":
136 - $player_tech = "*,-dash";
137 - break;
138 - case "noflash":
139 - $player_tech = "*,-hss";
140 - break;
141 - case "nozen":
142 - $player_tech = "*,-zen";
143 - break;
144 - case "noios":
145 - $player_tech = "*,-hlse";
146 - break;
147 - default:
148 - break;
149 - }
150 - // tech override ends
151 -
152 126 // Old Embed Code
153 - if ($vdo_embed_version_str === '0.5') {
127 + if($vdo_embed_version_str === '0.5') {
154 128 $output = "<div id='vdo$OTP' style='height:$height;width:$width;max-width:100%' ></div>";
155 129 $output .= "<script> (function(v,i,d,e,o){v[o]=v[o]||{}; v[o].add = v[o].add || function V(a){".
156 130 " (v[o].d=v[o].d||[]).push(a);};";
157 - $output .= "if(!v[o].l) { v[o].l=1*new Date();a=i.createElement(d),m=i.getElementsByTagName(d)[0];a.async=1;".
131 + $output .= "if(!v[o].l) { v[o].l=1*new Date(); a=i.createElement(d), m=i.getElementsByTagName(d)[0]; a.async=1; ".
158 132 "a.src=e; m.parentNode.insertBefore(a,m);}";
159 133 $output .= " })(window,document,'script','//de122v0opjemw.cloudfront.net/vdo.js','vdo'); vdo.add({ ";
160 134 $output .= "o: '$OTP', ";
161 135 if ($version == 32) {
@@ -161,18 +135,13 @@
161 135 if ($version == 32) {
162 136 $output .= "version: '$version' ";
163 137 }
164 138 $output .= "}); </script>";
165 - } else {
166 - //New embed code
167 - if ($player_tech === '') {
168 - if (get_option(vdo_watermark_flash_html) === 'flash') {
169 - $player_tech = "*,-dash";
170 - }
171 - }
139 + }
140 + //New embed code
141 + else {
172 142 $output .= "<div id='vdo$OTP' style='height:$height;width:$width;max-width:100%' ></div>";
173 - $output .= "<script>(function(v,i,d,e,o){v[o]=v[o]||{}; v[o].add = v[o].add || function V(a){".
174 - "(v[o].d=v[o].d||[]).push(a);};";
143 + $output .= "<script>(function(v,i,d,e,o){v[o]=v[o]||{}; v[o].add = v[o].add || function V(a){ (v[o].d=v[o].d||[]).push(a);};";
175 144 $output .= "if(!v[o].l) { v[o].l=1*new Date(); a=i.createElement(d), m=i.getElementsByTagName(d)[0];";
176 145 $output .= "a.async=1; a.src=e; m.parentNode.insertBefore(a,m);}";
177 146 $output .= "})(window,document,'script','https://d1z78r8i505acl.cloudfront.net/playerAssets/";
178 147 $output .= "$vdo_embed_version_str";
@@ -181,20 +150,8 @@
181 150 $output .= "otp: '$OTP',";
182 151 $output .= "playbackInfo: btoa(JSON.stringify({";
183 152 $output .= "videoId: '$video'})),";
184 153 $output .= "theme: '$vdo_player_theme',";
185 - if ($player_tech !== '') {
186 - $output .= "techoverride: [" ;
187 - $techarray = explode(',', $player_tech);
188 - for ($i = 0; $i < sizeof($techarray); $i++) {
189 - $techStr = $techarray[$i];
190 - $output .= "'$techStr'";
191 - if ($i !== sizeof($techarray)-1) {
192 - $output .= ", ";
193 - }
194 - }
195 - $output .= "],";
196 - }
197 154 $output .= "container: document.querySelector('#vdo$OTP'),});";
198 155 $output .= "</script>";
199 156 }
200 157 return $output;
@@ -221,24 +178,17 @@
221 178 // non-admin enqueues, actions, and filters
222 179 }
223 180 function vdo_menu()
224 181 {
225 - add_menu_page(
226 - 'VdoCipher Options',
227 - 'VdoCipher',
228 - 'manage_options',
229 - 'vdocipher',
230 - 'vdo_options',
231 - plugin_dir_url(__FILE__).'images/logo.png'
232 - );
182 + add_menu_page('VdoCipher Options', 'VdoCipher', 'manage_options', 'vdocipher', 'vdo_options');
233 183 }
234 184 function vdo_options()
235 185 {
236 186 if (!get_option('vdo_default_height')) {
237 - update_option('vdo_default_height', 'auto');
187 + update_option('vdo_default_height', '360');
238 188 }
239 189 if (!get_option('vdo_default_width')) {
240 - update_option('vdo_default_width', '1280');
190 + update_option('vdo_default_width', '640');
241 191 }
242 192 $vdo_client_key = get_option('vdo_client_key');
243 193 if (!$vdo_client_key && strlen($vdo_client_key) != 64) {
244 194 vdo_show_form_client_key();
@@ -257,9 +207,8 @@
257 207 register_setting('vdo_option-group', 'vdo_default_width');
258 208 register_setting('vdo_option-group', 'vdo_annotate_code');
259 209 register_setting('vdo_option-group', 'vdo_embed_version');
260 210 register_setting('vdo_option-group', 'vdo_player_theme');
261 - register_setting('vdo_option-group', 'vdo_watermark_flash_html');
262 211 }
263 212
264 213 /// adding a section for asking for the client key
265 214 function vdo_show_form_client_key()
@@ -274,27 +223,23 @@
274 223 delete_option('vdo_default_height');
275 224 delete_option('vdo_annotate_code');
276 225 delete_option('vdo_embed_version');
277 226 delete_option('vdo_player_theme');
278 - delete_option('vdo_watermark_flash_html');
279 227 }
280 228 function vdo_activate()
281 229 {
282 230 if ((get_option('vdo_default_height')) == false) {
283 - update_option('vdo_default_height', 'auto');
231 + update_option('vdo_default_height', '360');
284 232 }
285 233 if ((get_option('vdo_default_width')) == false) {
286 - update_option('vdo_default_width', '1280');
234 + update_option('vdo_default_width', '640');
287 235 }
288 236 //https://stackoverflow.com/a/2173318/5022684
289 237 if ((get_option('vdo_embed_version')) == false) {
290 - update_option('vdo_embed_version', '1.6.4');
238 + update_option('vdo_embed_version', '0.5');
291 239 }
292 240 if ((get_option('vdo_player_theme')) == false) {
293 - update_option('vdo_player_theme', '9ae8bbe8dd964ddc9bdb932cca1cb59a');
294 - }
295 - if ((get_option('vdo_watermark_flash_html')) == false) {
296 - update_option('vdo_watermark_flash_html', 'html5');
241 + update_option('vdo_player_theme','9ae8bbe8dd964ddc9bdb932cca1cb59a');
297 242 }
298 243 }
299 244 register_activation_hook(__FILE__, 'vdo_activate');
300 245 function vdo_admin_notice()