Changeset 1176986
- Timestamp:
- 06/08/2015 07:05:58 PM (11 years ago)
- Location:
- ooyala-video-browser/trunk
- Files:
-
- 5 edited
-
js/ooyala-views.js (modified) (1 diff)
-
ooyala-templates.php (modified) (15 diffs)
-
ooyala.css (modified) (1 diff)
-
ooyala.php (modified) (13 diffs)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ooyala-video-browser/trunk/js/ooyala-views.js
r1169444 r1176986 798 798 initialize: function() { 799 799 media.view.Attachment.prototype.initialize.apply(this, arguments); 800 this.$el.addClass('ooyala-attachment-item'); 800 801 801 802 this.model.on('change:status', this.changeStatus, this); -
ooyala-video-browser/trunk/ooyala-templates.php
r1169444 r1176986 74 74 75 75 <# if ( data.buttons.close ) { #> 76 <a class="close media-modal-icon" href="#" title="<?php _e('Remove'); ?>"></a>76 <a class="close media-modal-icon" href="#" title="<?php esc_attr_e( 'Remove', 'ooyala' ); ?>"></a> 77 77 <# } #> 78 78 79 79 <# if ( data.buttons.check ) { #> 80 <a class="check" href="#" title="<?php _e('Deselect'); ?>"><div class="media-modal-icon"></div></a>80 <a class="check" href="#" title="<?php esc_attr_e( 'Deselect', 'ooyala' ); ?>"><div class="media-modal-icon"></div></a> 81 81 <# } #> 82 82 </div> … … 94 94 <dl class="ooyala-image-details-list"> 95 95 96 <dt class="ooyala-title"><?php _e( "Title: ", 'ooyala' ); ?></dt>96 <dt class="ooyala-title"><?php esc_html_e( "Title: ", 'ooyala' ); ?></dt> 97 97 <dd class="ooyala-title">{{ data.name }}</dd> 98 98 99 99 <# if (data.duration) { #> 100 <dt class="ooyala-duration"><?php _e( "Duration: ", 'ooyala' ); ?></dt>100 <dt class="ooyala-duration"><?php esc_html_e( "Duration: ", 'ooyala' ); ?></dt> 101 101 <dd class="ooyala-duration">{{ data.duration_string }}</dd> 102 102 <# } #> 103 103 104 <dt class="ooyala-status"><?php _e( "Status: ", 'ooyala' ); ?></dt>104 <dt class="ooyala-status"><?php esc_html_e( "Status: ", 'ooyala' ); ?></dt> 105 105 <dd class="ooyala-status ooyala-status-{{ data.status }} {{ data.status == 'processing' ? 'loading' : '' }}">{{ data.status }} 106 106 <# if (data.status=='uploading' && data.percent !== undefined) { #> … … 110 110 111 111 <# if ( data.description ) { #> 112 <dt class="ooyala-description"><?php _e( "Description: ", 'ooyala' ); ?></dt>112 <dt class="ooyala-description"><?php esc_html_e( "Description: ", 'ooyala' ); ?></dt> 113 113 <# if ( data.description.length > ( data.descriptionMaxLen + data.maxLenThreshold ) ) { 114 114 var trunc = data.description.lastIndexOf(" ", data.descriptionMaxLen); … … 123 123 <# if(data.labels && data.labels.length > 0) { 124 124 #> 125 <dt class="ooyala-labels"><?php _e( "Labels: ", 'ooyala' ); ?></dt>125 <dt class="ooyala-labels"><?php esc_html_e( "Labels: ", 'ooyala' ); ?></dt> 126 126 <dd class="ooyala-labels"> 127 127 <ul> … … 143 143 <div class="message"><?php esc_html_e( 'This asset may not display correctly due to its current status. Do you wish to embed it anyway?', 'ooyala' ); ?><a href="#">Show Player Settings</a></div> 144 144 <label class="setting"> 145 <span><?php _e( 'Player', 'ooyala' ); ?></span>145 <span><?php esc_html_e( 'Player', 'ooyala' ); ?></span> 146 146 <# if ( data.players.isFetching ) { #> 147 <em class="loading"><?php _e( 'Retrieving players', 'ooyala' ); ?></em>147 <em class="loading"><?php esc_html_e( 'Retrieving players', 'ooyala' ); ?></em> 148 148 <# } else { #> 149 149 <select data-setting="player_id"> … … 157 157 158 158 <label class="setting"> 159 <span><?php _e( 'Platform', 'ooyala' ); ?></span>159 <span><?php esc_html_e( 'Platform', 'ooyala' ); ?></span> 160 160 <select data-setting="platform"> 161 <option value=""><?php _e( 'Default', 'ooyala' ); ?></option>161 <option value=""><?php esc_html_e( 'Default', 'ooyala' ); ?></option> 162 162 <# _.each(['flash','flash-only','html5-fallback','html5-priority'], function(value) { #> 163 163 <option value="{{ value }}">{{ value }}</option> … … 167 167 168 168 <div class="setting resolution"> 169 <span><?php _e( 'Size', 'ooyala' ); ?></span>169 <span><?php esc_html_e( 'Size', 'ooyala' ); ?></span> 170 170 <# if (data.model.attachment.get('downloadingResolutions')) { #> 171 <em class="loading"><?php _e( 'Retrieving video resolutions', 'ooyala' ); ?></em>171 <em class="loading"><?php esc_html_e( 'Retrieving video resolutions', 'ooyala' ); ?></em> 172 172 <# } else { #> 173 173 <select data-setting="resolution"> … … 179 179 <# } 180 180 } #> 181 <option value="custom"><?php _e( 'Custom', 'ooyala' ); ?></option>181 <option value="custom"><?php esc_html_e( 'Custom', 'ooyala' ); ?></option> 182 182 </select> 183 183 <div class="custom-resolution"> … … 185 185 X 186 186 <input type="text" data-setting="height"/> 187 <label><input type="checkbox" data-setting="lockAspectRatio"> <?php _e( 'Maintain aspect ratio', 'ooyala' ); ?></label>188 </div> 189 <# } #> 190 </div> 191 192 <label class="setting"> 193 <span><?php _e( 'Enable Channels', 'ooyala' ); ?></span>187 <label><input type="checkbox" data-setting="lockAspectRatio"> <?php esc_html_e( 'Maintain aspect ratio', 'ooyala' ); ?></label> 188 </div> 189 <# } #> 190 </div> 191 192 <label class="setting"> 193 <span><?php esc_html_e( 'Enable Channels', 'ooyala' ); ?></span> 194 194 <input type="checkbox" data-setting="enable_channels"/> 195 195 </label> 196 196 197 197 <label class="setting initial-time"> 198 <span><?php _e( 'Initial Time', 'ooyala' ); ?></span>199 <input type="text" data-setting="initial_time" min="0" max="{{ data.model.attachment.get('duration') / 1000 }}"> <?php _e( 'sec', 'ooyala' ); ?>200 </label> 201 202 <label class="setting"> 203 <span><?php _e( 'Locale', 'ooyala' ); ?></span>198 <span><?php esc_html_e( 'Initial Time', 'ooyala' ); ?></span> 199 <input type="text" data-setting="initial_time" min="0" max="{{ data.model.attachment.get('duration') / 1000 }}"> <?php esc_html_e( 'sec', 'ooyala' ); ?> 200 </label> 201 202 <label class="setting"> 203 <span><?php esc_html_e( 'Locale', 'ooyala' ); ?></span> 204 204 <select data-setting="locale"> 205 <option value=''> User Default</option>205 <option value=''><?php esc_html_e( 'User Default', 'ooyala' ); ?></option> 206 206 <?php 207 207 $locales = array( … … 225 225 226 226 <label class="setting additional-parameters"> 227 <span><?php _e( 'Additional Player Parameters', 'ooyala' ); ?></span>228 <em class="error-message"><?php _e( 'There is an error in your syntax:', 'ooyala' ); ?></em>229 <textarea data-setting="additional_params_raw" placeholder=" Key/value pairs in JSON or JavaScript object literal notation">{{ data.model.additional_params }}</textarea>227 <span><?php esc_html_e( 'Additional Player Parameters', 'ooyala' ); ?></span> 228 <em class="error-message"><?php esc_html_e( 'There is an error in your syntax:', 'ooyala' ); ?></em> 229 <textarea data-setting="additional_params_raw" placeholder="<?php esc_attr_e( 'Key/value pairs in JSON or JavaScript object literal notation', 'ooyala' ); ?>">{{ data.model.additional_params }}</textarea> 230 230 </label> 231 231 </div> … … 239 239 <div class="ooyala-more-text-container"> 240 240 <!--// <span class="ooyala-number-remaining"></span> //--> 241 <span class="ooyala-more-text"><?php _e( "More", 'ooyala' ); ?></span>241 <span class="ooyala-more-text"><?php esc_html_e( "More", 'ooyala' ); ?></span> 242 242 </div> 243 243 </div> … … 246 246 <!-- Unsupported browser message --> 247 247 <script type="text/html" id="tmpl-ooyala-unsupported-browser"> 248 <h1><?php _e( "Sorry, this browser is unsupported!", 'ooyala' ); ?></h1>249 250 <p><?php _e( "The Ooyala plugin requires at least Internet Explorer 10 to function. This plugin also supports other modern browsers with proper CORS support such as Firefox, Chrome, Safari, and Opera.", 'ooyala' ); ?></p>248 <h1><?php esc_html_e( "Sorry, this browser is unsupported!", 'ooyala' ); ?></h1> 249 250 <p><?php esc_html_e( "The Ooyala plugin requires at least Internet Explorer 10 to function. This plugin also supports other modern browsers with proper CORS support such as Firefox, Chrome, Safari, and Opera.", 'ooyala' ); ?></p> 251 251 </script> 252 252 … … 258 258 var isUploading = data.controller.uploader.state === ooyala.plupload.STARTED; 259 259 #> 260 <div class="file-name"> File:{{ file.name }} <em class="file-size">({{ new Number( file.size ).bytesToString() }})</em>260 <div class="file-name"><?php esc_html_e( 'File:', 'ooyala' ); ?> {{ file.name }} <em class="file-size">({{ new Number( file.size ).bytesToString() }})</em> 261 261 <# if( !isUploading ) { #> 262 <a class="button ooyala-upload-browser" tabindex="10"> Change</a>263 <# } #> 264 </div> 265 <label class="setting"> Title<input type="text" value="{{ file.model.get('name') }}" data-setting="name" tabindex="20"></label>266 <label class="setting"> Description<textarea data-setting="description" tabindex="30">{{ file.model.get('description') }}</textarea></label>267 <label class="setting"> Post-processing Status262 <a class="button ooyala-upload-browser" tabindex="10"><?php esc_html_e( 'Change', 'ooyala' ); ?></a> 263 <# } #> 264 </div> 265 <label class="setting"><?php esc_html_e( 'Title', 'ooyala' ); ?><input type="text" value="{{ file.model.get('name') }}" data-setting="name" tabindex="20"></label> 266 <label class="setting"><?php esc_html_e( 'Description', 'ooyala' ); ?><textarea data-setting="description" tabindex="30">{{ file.model.get('description') }}</textarea></label> 267 <label class="setting"><?php esc_html_e( 'Post-processing Status', 'ooyala' ); ?> 268 268 <select data-setting="futureStatus" tabindex="40"> 269 269 <# var status = ['live','paused']; … … 274 274 <div class="ooyala-upload-controls {{ isUploading ? 'uploading' : '' }}"> 275 275 <div class="progress"><span>{{ ( file.model.asset && file.model.asset.get('percent') ) || 0 }}</span>%</div> 276 <a class="button ooyala-stop-upload" tabindex="60"> Cancel Upload</a>277 <a class="button ooyala-start-upload" tabindex="50"> Start Upload</a>276 <a class="button ooyala-stop-upload" tabindex="60"><?php esc_html_e( 'Cancel Upload', 'ooyala' ); ?></a> 277 <a class="button ooyala-start-upload" tabindex="50"><?php esc_html_e( 'Start Upload', 'ooyala' ); ?></a> 278 278 </div> 279 279 <# } else { #> 280 280 <div class="ooyala-upload-browser-container"> 281 <h4> Upload an asset to your account.</h4>282 <a class="button button-hero ooyala-upload-browser"> Select File</a>281 <h4><?php esc_html_e( 'Upload an asset to your account.', 'ooyala' ); ?></h4> 282 <a class="button button-hero ooyala-upload-browser"><?php esc_html_e( 'Select File', 'ooyala' ); ?></a> 283 283 </div> 284 284 <# } #> … … 289 289 <?php esc_html_e( 'Refining by Label:', 'ooyala' ); ?> 290 290 <span class="ooyala-selected-label"></span> 291 <a href="#" title=" Clear Label" class="ooyala-clear-label dashicons dashicons-dismiss"></a>292 </script> 291 <a href="#" title="<?php esc_attr_e( 'Clear Label', 'ooyala' ); ?>" class="ooyala-clear-label dashicons dashicons-dismiss"></a> 292 </script> -
ooyala-video-browser/trunk/ooyala.css
r1169444 r1176986 308 308 margin-right: 7px; 309 309 } 310 .ooyala-toolbar li.attachment:focus, .ooyala-results li.attachment:focus:not(.selected) { 310 .ooyala-toolbar li.attachment.ooyala-attachment-item:focus, 311 .ooyala-toolbar li.attachment.ooyala-attachment-item, 312 .ooyala-results li.attachment.ooyala-attachment-item:focus:not(.selected) { 311 313 -webkit-box-shadow: none; 312 314 box-shadow: none; -
ooyala-video-browser/trunk/ooyala.php
r1169444 r1176986 3 3 Plugin name: Ooyala 4 4 Plugin URI: http://www.oomphinc.com/work/ooyala-wordpress-plugin/ 5 Description: Integrate your site with Ooyala6 Author: bendoh5 Description: Easy Embedding of Ooyala Videos based off an Ooyala Account as defined in media settings. 6 Author: ooyala 7 7 Author URI: http://oomphinc.com/ 8 Version: 2.0 8 Version: 2.0.1 9 9 */ 10 10 11 /* Copyright 201 4Ooyala11 /* Copyright 2015 Ooyala 12 12 13 13 This program is free software; you can redistribute it and/or modify … … 52 52 // some of these field names differ from the player API bc WP lowercases shortcode params, they are mapped below 53 53 public $playerDefaults = array( 54 'platform' => '', //if none is supplied, this defaults to flash 55 'width' => '600', //if none are provided by the asset's streams 54 'code' => '', 55 'player_id' => '', 56 'platform' => 'html5-fallback', 57 'width' => '500', //if none are provided by the asset's streams 56 58 'height' => '400', 57 59 'enable_channels' => false, 60 'wmode' => 'opaque', 58 61 'initial_time' => '0', 62 'autoplay' => '', 63 'wrapper_class' => 'ooyala-video-wrapper', 64 'callback' => 'recieveOoyalaEvent', 59 65 'locale' => '', //equivalent to "User Default" aka providing no locale 60 66 'additional_params' => '', //these will come through as the shortcode content, if supplied … … 67 73 ); 68 74 75 public $allowed_values = array( 76 'wmode' => array( 'window', 'transparent', 'opaque', 'gpu', 'direct' ), 77 'platform' => array( 'flash', 'flash-only', 'html5-fallback', 'html5-priority' ), 78 ); 79 69 80 var $settings_default = array( 70 'key' => '', 71 'secret' => '' 81 'api_key' => '', 82 'api_secret' => '', 83 'video_width' => '', 84 'player_id' => '', //default player ID 72 85 ); 73 86 … … 123 136 */ 124 137 function settings_fields() { 125 $option = get_option( self::settings_key, $this->settings_default); ?>138 $option = $this->get_settings(); ?> 126 139 <table class="form-table" id="ooyala"> 127 140 <tr> 128 141 <th scope="row"><label for="ooyala-apikey"><?php esc_html_e( "API Key", 'ooyala' ); ?></label></th> 129 <td scope="row"><input type="text" name="ooyala[ key]" class="widefat" id="ooyala-apikey" value="<?php echo esc_attr( $option['key'] ); ?>" /></td>142 <td scope="row"><input type="text" name="ooyala[api_key]" class="widefat" id="ooyala-apikey" value="<?php echo esc_attr( $option['api_key'] ); ?>" /></td> 130 143 </tr> 131 144 <tr> 132 145 <th scope="row"><label for="ooyala-apisecret"><?php esc_html_e( "API Secret", 'ooyala' ); ?></label></th> 133 <td scope="row"><input type="text" name="ooyala[ secret]" class="widefat" id="ooyala-apisecret" value="<?php echo esc_attr( $option['secret'] ); ?>" /></td>146 <td scope="row"><input type="text" name="ooyala[api_secret]" class="widefat" id="ooyala-apisecret" value="<?php echo esc_attr( $option['api_secret'] ); ?>" /></td> 134 147 </tr> 135 148 <tr> … … 138 151 </td> 139 152 </tr> 153 <tr> 154 <th scope="row"><label for="ooyala-playerid"><?php esc_html_e( 'Default Player ID', 'ooyala' ); ?></label></th> 155 <td scope="row"><input type="text" name="ooyala[player_id]" class="widefat" id="ooyala-playerid" value="<?php echo esc_attr( $option['player_id'] ); ?>" /></td> 156 </tr> 157 <tr> 158 <th scope="row"><label for="ooyala-videowidth"><?php esc_html_e( 'Default Video Width', 'ooyala' ); ?></label></th> 159 <td scope="row"><input type="text" name="ooyala[video_width]" id="ooyala-videowidth" value="<?php echo esc_attr( $option['video_width'] ); ?>" />px</td> 160 </tr> 140 161 </table> 141 162 <?php … … 148 169 $validated = $this->settings_default; 149 170 150 if( isset( $settings['key'] ) && is_string( $settings['key'] ) ) { 151 $validated['key'] = sanitize_text_field( $settings['key'] ); 152 } 153 154 if( isset( $settings['secret'] ) && is_string( $settings['secret'] ) ) { 155 $validated['secret'] = sanitize_text_field( $settings['secret'] ); 171 foreach ( $this->settings_default as $key => $value ) { 172 if( isset( $settings[ $key ] ) && is_string( $settings[ $key ] ) ) { 173 $validated[ $key ] = sanitize_text_field( $settings[ $key ] ); 174 } 156 175 } 157 176 158 177 return $validated; 178 } 179 180 /** 181 * Get the user's saved settings for this plugin, filled in with default values. 182 * @return array settings or defaults 183 */ 184 function get_settings() { 185 return get_option( self::settings_key, $this->settings_default ); 159 186 } 160 187 … … 165 192 */ 166 193 function ajax_sign_request() { 167 $settings = get_option( self::settings_key, $this->settings_default);194 $settings = $this->get_settings(); 168 195 169 196 if( !$this->configured() ) { … … 187 214 ) ); 188 215 189 $request['params']['api_key'] = $settings[' key'];216 $request['params']['api_key'] = $settings['api_key']; 190 217 $request['params']['expires'] = time() + 300; 191 218 192 $to_sign = $settings[' secret'] . $request['method'] . $request['path'];219 $to_sign = $settings['api_secret'] . $request['method'] . $request['path']; 193 220 194 221 $param_sorted = array_keys( $request['params'] ); … … 263 290 // Ensure all the files required by the media manager are present 264 291 wp_enqueue_media(); 265 266 wp_register_script( 'jquery-cookie', plugins_url( '/js/jquery.cookie.js', __FILE__ ), array( 'jquery' ), '2006', true );267 292 268 293 wp_enqueue_script( 'spin-js', plugins_url( '/js/spin.js', __FILE__ ), array(), 1, true ); … … 281 306 'model' => array(), // Backbone models 282 307 'view' => array(), // Backbone views 283 'api' => get_option( self::settings_key, $this->settings_default),308 'api' => $this->get_settings(), 284 309 'sign' => admin_url( 'admin-ajax.php?action=ooyala_sign_request&nonce=' . wp_create_nonce( 'ooyala' ) ), 285 310 'playerDefaults' => $this->playerDefaults, … … 339 364 */ 340 365 function configured() { 341 $settings = get_option( self::settings_key, $this->settings_default);342 343 return !empty( $settings[' key'] ) && !empty( $settings['secret'] );366 $settings = $this->get_settings(); 367 368 return !empty( $settings['api_key'] ) && !empty( $settings['api_secret'] ); 344 369 } 345 370 … … 356 381 ?> 357 382 <div class="update-nag"> 358 <?php printf( __( 'Your Ooyala API credentials are not configured in <a href="%s">Media Settings</a>.', 'ooyala' ), esc_url( $url) ); ?>383 <?php echo wp_kses_post( sprintf( __( 'Your Ooyala API credentials are not configured in <a href="%s">Media Settings</a>.', 'ooyala' ), esc_url( $url ) ) ); ?> 359 384 </div> 360 385 <?php … … 376 401 function shortcode( $atts, $content = null ) { 377 402 static $num; 378 if ( !$atts['code'] || !$atts['player_id'] ) { 403 // do not display markup in feeds 404 if ( is_feed() ) { 379 405 return; 380 406 } 407 // handle the 'legacy' shortcode format: [ooyala code12345] 408 if ( empty( $atts['code'] ) ) { 409 if ( isset( $atts[0] ) ) { 410 $atts['code'] = $atts[0]; 411 } else { 412 // we need a code! 413 return; 414 } 415 } 381 416 $num++; 417 $settings = $this->get_settings(); 418 // fill in defaults saved in user settings 419 if ( empty( $atts['player_id'] ) && !empty( $settings['player_id'] ) ) { 420 $atts['player_id'] = $settings['player_id']; 421 } 422 // set a width from some defaults 423 if ( empty( $atts['width'] ) ) { 424 if ( !empty( $settings['video_width'] ) ) { 425 $atts['width'] = $settings['video_width']; 426 } elseif ( !empty( $GLOBALS['content_width'] ) ) { 427 $atts['width'] = $GLOBALS['content_width']; 428 } 429 } 430 // fill in remaining player defaults 431 $atts = shortcode_atts( apply_filters( 'ooyala_default_query_args', $this->playerDefaults ), $atts ); 382 432 //coerce string true and false to their respective boolean counterparts 383 433 $atts = array_map( function($value) { if ($value==='true') return true; elseif ($value==='false') return false; else return $value; }, $atts ); 384 434 385 // fill in default width / height vals 386 $atts['width'] = intval( isset( $atts['width'] ) ? $atts['width'] : $this->playerDefaults['width'] ); 387 $atts['height'] = intval( isset( $atts['height'] ) ? $atts['height'] : $this->playerDefaults['height'] ); 388 389 // player query string parameters 390 $query_params = array( 391 'namespace' => 'OoyalaPlayer' . $num // each player has its own namespace to avoid collisions 392 ); 393 394 // JS parameters - start with passed json, if any 395 if ( $content 396 && ( $json = json_decode( $content, true ) ) 397 && is_array( $json ) 398 && count( array_filter( array_keys( $json ), 'is_string' ) ) //only if assoc array 399 ) { 400 $js_params = $json; 435 // match against allowed values 436 foreach ( array( 'wmode', 'platform' ) as $att ) { 437 $atts[ $att ] = in_array( $atts[ $att ], $this->allowed_values[ $att ] ) ? $atts[ $att ] : $this->playerDefaults[ $att ]; 438 } 439 440 ob_start(); 441 if ( !empty( $atts['player_id'] ) ) { 442 // player query string parameters 443 $query_params = array( 444 'namespace' => 'OoyalaPlayer' . $num // each player has its own namespace to avoid collisions 445 ); 446 // JS parameters - start with passed json, if any 447 if ( $content 448 && ( $json = json_decode( $content, true ) ) 449 && is_array( $json ) 450 && count( array_filter( array_keys( $json ), 'is_string' ) ) //only if assoc array 451 ) { 452 $js_params = $json; 453 } else { 454 $js_params = array(); 455 } 456 457 // pick out all other params 458 foreach ( $atts as $key => $value ) { 459 switch ( $key ) { 460 // no-op bc these have special placement in the embed code 461 case 'width': 462 case 'height': 463 case 'code': 464 case 'player_id': 465 break; 466 467 // these are query params and are appended to the player script URL 468 case 'platform': 469 $query_params[$key] = $value; 470 break; 471 472 // all other params become JS parameters 473 // these will override values of the same name supplied from the JSON content block 474 default: 475 if ( !$this->is_default( $key, $value ) ) { 476 $js_params[ isset( $this->paramMapping[ $key ] ) ? $this->paramMapping[ $key ] : $key ] = $value; 477 } 478 break; 479 } 480 } 481 ?> 482 <script src="<?php echo esc_url( '//player.ooyala.com/v3/' . $atts['player_id'] . '?' . http_build_query( $query_params ) ); ?>"></script> 483 <div id="ooyalaplayer-<?php echo (int) $num; ?>" class="<?php echo esc_attr( $atts['wrapper_class'] ); ?>" style="width:<?php echo (int) $atts['width']; ?>px;height:<?php echo (int) $atts['height']; ?>px"></div> 484 <script> 485 <?php 486 $player = 'OoyalaPlayer' . $num; 487 $params = array( "ooyalaplayer-$num", $atts['code'] ); 488 if ( count( $js_params ) ) { 489 $params[] = $js_params; 490 } 491 echo esc_js( $player ) . '.ready(function() { ' . esc_js( $player ) . '.Player.create.apply(this, ' . json_encode( $params ) .'); });'; 492 ?> 493 </script> 494 <noscript><div><?php esc_html_e( 'Please enable Javascript to watch this video', 'ooyala' ); ?></div></noscript> 495 <?php 496 // no player id, use the v2 player 401 497 } else { 402 $js_params = array(); 403 } 404 405 // pick out all other params 406 foreach ( $atts as $key => $value ) { 407 switch ( $key ) { 408 // no-op bc these have special placement in the embed code 409 case 'width': 410 case 'height': 411 case 'code': 412 case 'player_id': 413 break; 414 415 // these are query params and are appended to the player script URL 416 case 'platform': 417 if ( !$this->is_default( $key, $value ) ) { 418 $query_params[$key] = $value; 419 } 420 break; 421 422 // all other params become JS parameters 423 // these will override values of the same name supplied from the JSON content block 424 default: 425 if ( !$this->is_default( $key, $value ) ) { 426 $js_params[ isset( $this->paramMapping[ $key ] ) ? $this->paramMapping[ $key ] : $key ] = $value; 427 } 428 break; 429 } 430 } 431 ob_start(); 432 ?> 433 <script src="<?php echo esc_url( '//player.ooyala.com/v3/' . $atts['player_id'] . '?' . http_build_query( $query_params ) ); ?>"></script> 434 <div id="ooyalaplayer-<?php echo $num; ?>" class="ooyala-player" style="width:<?php echo $atts['width']; ?>px;height:<?php echo $atts['height']; ?>px"></div> 435 <script> 498 $script_url = add_query_arg( array( 499 'width' => $atts['width'], 500 'height' => $atts['height'], 501 'embedCode' => $atts['code'], 502 'autoplay' => $atts['autoplay'] ? '1' : '0', 503 'callback' => $atts['callback'], 504 'wmode' => $atts['wmode'], 505 'version' => 2, 506 ), 'http://player.ooyala.com/player.js' ); 507 ?> 508 <div id="ooyalaplayer-<?php echo (int) $num; ?>" class="<?php echo esc_attr( $atts['wrapper_class'] ); ?>"> 509 <script src="<?php echo esc_url( $script_url ); ?>"></script> 510 <noscript> 511 <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="<?php echo (int) $atts['width']; ?>" height="<?php echo (int) $atts['height']; ?>" codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab"> 512 <param name="movie" value="<?php echo esc_url( 'http://player.ooyala.com/player.swf?embedCode=' . $atts['code'] . '&version=2' ); ?>"> 513 <param name="bgcolor" value="#000000"> 514 <param name="allowScriptAccess" value="always"> 515 <param name="allowFullScreen" value="true"> 516 <param name="wmode" value="<?php echo esc_attr( $atts['wmode'] ); ?>"> 517 <param name="flashvars" value="embedType=noscriptObjectTag&embedCode=###VID###"> 518 <embed src="<?php echo esc_url( 'http://player.ooyala.com/player.swf?embedCode=' . $atts['code'] . '&version=2' ); ?>" bgcolor="#000000" width="<?php echo (int) $atts['width']; ?>" height="<?php echo (int) $atts['height']; ?>" align="middle" play="true" loop="false" allowscriptaccess="always" allowfullscreen="true" type="application/x-shockwave-flash" flashvars="&embedCode=<?php echo esc_attr( $atts['code'] ); ?>" pluginspage="http://www.adobe.com/go/getflashplayer"> 519 </embed> 520 </object> 521 </noscript> 522 </div> 436 523 <?php 437 $player = 'OoyalaPlayer' . $num; 438 $params = array( "ooyalaplayer-$num", $atts['code'] ); 439 if ( count( $js_params ) ) { 440 $params[] = $js_params; 441 } 442 echo "$player.ready(function() { $player.Player.create.apply(this, " . json_encode( $params ) ."); });"; 443 ?> 444 </script> 445 <noscript><div>Please enable Javascript to watch this video</div></noscript> 446 <?php 524 } 447 525 return ob_get_clean(); 448 526 } -
ooyala-video-browser/trunk/readme.txt
r1169444 r1176986 1 1 === Ooyala === 2 Contributors: Ooyala2 Contributors: ooyala, thinkoomph, balbuf 3 3 Tags: video, media, ooyala 4 4 Requires at least: 3.9 5 5 Tested up to: 4.1.1 6 Stable tag: 2.0 6 Stable tag: 2.0.1 7 7 License: GPLv2 or later 8 8 … … 41 41 42 42 == Changelog == 43 44 = 2.0.1 = 45 * Backwards compatibility fixes to honor existing settings, including default player_id, video_width, and previously entered API key and secret. 43 46 44 47 = 2.0 = … … 79 82 * Added Automattic as contributor 80 83 81 = 1.4.2 = 84 = 1.4.2 = 82 85 * Provided more robustness around the API calls being made. 83 86 * Updated documentation to direct users to the V1 API keys. 84 87 85 = 1.4.1 = 88 = 1.4.1 = 86 89 * Fixed a deprecated function call 87 90 * Changed the default timeout for the remote request to 10 seconds. If you need to further extend the timeout for any reason, you can also use the 'ooyala_http_request_timeout' filter.
Note: See TracChangeset
for help on using the changeset viewer.