Plugin Directory

Changeset 901424


Ignore:
Timestamp:
04/24/2014 03:58:34 AM (12 years ago)
Author:
jamie3d
Message:

Adding version 1.2.4 with an override for YouTube 16:9 ratios.

Location:
fluid-video-embeds/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • fluid-video-embeds/trunk/fluid-video-embeds.php

    r887847 r901424  
    55Description: Makes your YouTube and Vimeo auto-embeds fluid/full width.
    66Author: jamie3d
    7 Version: 1.2.3
     7Version: 1.2.4
    88Author URI: http://jamie3d.com
    99*/
     
    3333            'fve_alignment' => 'left',
    3434            'fve_responsive_hyperlink' => false,
     35            'fve_force_youtube_16_9' => false,
    3536            'fve_responsive_hyperlink_mq' => '@media screen and (max-device-width: 768px)',
    3637            );
     
    5657        if ( empty( $this->fve_responsive_hyperlink_mq ) ) {
    5758            $this->fve_responsive_hyperlink_mq = $this->defaults['fve_responsive_hyperlink_mq'];
     59        }
     60
     61        // Autoload the Responsive Hyperlink options
     62        $this->fve_force_youtube_16_9 = (bool) $this->get_option( 'fve_force_youtube_16_9' );
     63        if ( empty( $this->fve_force_youtube_16_9 ) ) {
     64            $this->fve_force_youtube_16_9 = $this->defaults['fve_force_youtube_16_9'];
    5865        }
    5966
     
    369376                     */
    370377                    $wrapper_padding = '75%';
    371                     if( $this->meta['aspect'] == 'widescreen' ) {
     378                    if( isset( $this->meta['aspect'] ) && $this->meta['aspect'] == 'widescreen' ) {
    372379                        $wrapper_padding = '56.25%';
    373380                    }
     
    375382                    $iframe_url = 'http://www.youtube.com/embed/' . $this->meta['id'] . '?wmode=transparent&modestbranding=1&autohide=1&showinfo=0&rel=0';
    376383                    $permalink = 'http://www.youtube.com/watch?v=' . $this->meta['id'];
    377                     $thumbnail = $this->meta['full_image'];
     384                    $thumbnail = isset( $this->meta['full_image'] ) ? $this->meta['full_image'] : '';
    378385                    break;
    379386                    case 'vimeo':
     
    382389                    $iframe_url = 'http://player.vimeo.com/video/' . $this->meta['id'] . '?portrait=0&byline=0&title=0';
    383390                    $permalink = 'http://vimeo.com/' . $this->meta['id'];
    384                     $thumbnail = $this->meta['full_image'];
     391                    $thumbnail = isset( $this->meta['full_image'] ) ? $this->meta['full_image'] : '';
    385392                    break;
    386393                }
     
    629636                switch( $service ){
    630637                    case 'youtube':
     638
     639                    if( $response_json->pageInfo->totalResults == 0 ) break;
     640
    631641                    $video_meta['title'] = $response_json->items[0]->snippet->title;
    632642                    $video_meta['permalink'] = 'http://www.youtube.com/watch?v=' . $video_id;
     
    638648                    if( isset( $response_json->items[0]->contentDetails->definition ) ) {
    639649                        $video_meta['aspect'] = ( $response_json->items[0]->contentDetails->definition === 'hd' ) ? 'widescreen' : 'standard';
     650                    }
     651
     652                    // Allow the widescreen option to be overriden
     653                    if( $this->fve_force_youtube_16_9 ) {
     654                        $video_meta['aspect'] = 'widescreen';
    640655                    }
    641656                    $video_meta['duration'] = $response_json->items[0]->contentDetails->duration;
  • fluid-video-embeds/trunk/lib/constants.php

    r887847 r901424  
    77
    88// The current version of this plugin
    9 if( !defined( 'FLUID_VIDEO_EMBEDS_VERSION' ) ) define( 'FLUID_VIDEO_EMBEDS_VERSION', '1.2.3' );
     9if( !defined( 'FLUID_VIDEO_EMBEDS_VERSION' ) ) define( 'FLUID_VIDEO_EMBEDS_VERSION', '1.2.4' );
    1010
    1111// The cache prefix
  • fluid-video-embeds/trunk/readme.txt

    r887847 r901424  
    6363
    6464== Changelog ==
     65= 1.2.4 =
     66* Fixes a few PHP notices due to empty API results.
     67* Adds a new YouTube option that allows you to force the 16:9 ratio.
     68
    6569= 1.2.3 =
    6670* Upgraded to version 3 of the YouTube API.
     
    100104
    101105== Upgrade Notice ==
     106= 1.2.4 =
     107* Adds a new YouTube option that allows you to force the 16:9 ratio.
     108
    102109= 1.2.3 =
    103110* Fixes bug with 4:3 YouTube aspect ratio (SD) videos.
  • fluid-video-embeds/trunk/views/options.php

    r887847 r901424  
    3333                </div>
    3434            </li>
     35            <li class="fve_youtube_options settings-group">
     36                <h3><?php _e( 'YouTube Options', $namespace ); ?></h3>
     37                <input id="fve_force_youtube_16_9" name="data[fve_force_youtube_16_9]" type="checkbox" size="3" value="yes"<?php echo ( $this->fve_force_youtube_16_9 == true ) ? ' checked="checked"' : ''; ?>>
     38                <label for="fve_force_youtube_16_9"><?php _e( 'Force 16:9 aspect Ratio?', $namespace ); ?></label>
     39
     40                <p class="description"><?php _e( 'Disables aspect ratio detection for YouTube.', $namespace ); ?></p>
     41                <p class="description"><?php _e( 'Although YouTube videos uploaded at a 4:3 ratio look better in a 4:3 player, some people have YouTube videos that are 480p but 16:9. This option makes 480p 16:9 videos look better.', $namespace ); ?></p>
     42            </li>
    3543            <li class="submit-row">
    3644                <input type="submit" name="submit" class="button-primary" value="<?php _e( "Save Changes", $namespace ) ?>" />
Note: See TracChangeset for help on using the changeset viewer.