Plugin Directory

Changeset 767688


Ignore:
Timestamp:
09/06/2013 04:31:36 AM (13 years ago)
Author:
jamie3d
Message:

Changing the way YouTube determines a widescreen video.

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

Legend:

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

    r608160 r767688  
    55Description: Makes your YouTube and Vimeo auto-embeds fluid/full width.
    66Author: jamie3d
    7 Version: 1.1.0
     7Version: 1.1.1
    88Author URI: http://jamie3d.com
    99*/
     
    364364                        $video_meta['created_at'] = strtotime( $response_json->entry->published->{'$t'} );
    365365                        $video_meta['aspect'] = 'standard';
    366                         if( isset( $response_json->entry->{'media$group'}->{'yt$aspectRatio'} ) ) {
    367                             $video_meta['aspect'] = ( $response_json->entry->{'media$group'}->{'yt$aspectRatio'}->{'$t'} == 'widescreen' ) ? 'widescreen' : 'standard';
     366                        if( isset( $response_json->entry->{'yt$hd'} ) ) {
     367                            $video_meta['aspect'] = ( isset( $response_json->entry->{'yt$hd'} ) ) ? 'widescreen' : 'standard';
    368368                        }
    369369                        $video_meta['duration'] = $response_json->entry->{'media$group'}->{'yt$duration'}->{'seconds'};
     
    454454register_activation_hook( __FILE__, array('FluidVideoEmbed', 'activate') );
    455455register_deactivation_hook( __FILE__, array('FluidVideoEmbed', 'deactivate') );
    456 
    457 ?>
  • fluid-video-embeds/trunk/readme.txt

    r648872 r767688  
    44Tags: video, youtube, vimeo, fluid, flexible, elastic, responsive, 100%, full width, embed, oEmbed
    55Requires at least: 3.3
    6 Tested up to: 3.5
     6Tested up to: 3.6
    77Stable tag: trunk
    88License: GPLv3
     
    3232for doing this is not very new (and is outlined in the credits links below), however I've added a bit of "sugar" to the mix. Since Vimeo and YouTube have robust,
    3333open APIs, I'm requesting information about each video server side (which is then cached) and used to determine the optimal aspect ratio for the video container.
     34
     35Note (September 2013): YouTube's API is not always returning the property I'm looking for. For newer videos, this may not work correctly in all cases. As a workaround, the default for YouTube has been changed to 'widescreen'.
    3436
    3537= Credits =
     
    6466
    6567== Changelog ==
     68= 1.1.1 =
     69Changed the way that YouTube widescreen videos are determined. It looks like they changed an API without letting us know.
     70
    6671= 1.1.0 =
    6772Adding a [fve] shortcode for use in your theme like this: `<?php echo do_shortcode('[fve]http://www.youtube.com/watch?v=oHg5SJYRHA0[/fve]'); ?>`
Note: See TracChangeset for help on using the changeset viewer.