Skip to content

Commit

Permalink
Merge pull request #89 from flowplayer/develop
Browse files Browse the repository at this point in the history
Version 1.10.7
  • Loading branch information
grappler committed Apr 5, 2015
2 parents 53fd66f + ee3ae47 commit 2dc511d
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 23 deletions.
17 changes: 17 additions & 0 deletions admin/class-flowplayer5-taxonomy-meta.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public function __construct() {
add_action( 'playlist_edit_form_fields', array( $this, 'taxonomy_edit_meta_field' ), 10, 2 );
add_filter( 'manage_edit-playlist_columns', array( $this, 'add_playlist_columns' ) );
add_filter( 'manage_playlist_custom_column', array( $this, 'add_playlist_column_content' ), 10, 3 );
add_action( 'split_shared_term', array( $this, 'update_playlist_order_for_split_terms' ), 10, 4 );

}

Expand Down Expand Up @@ -270,4 +271,20 @@ public function taxonomy_delete_meta_field( $term, $tt_id, $deleted_term ) {
delete_option( 'playlist_' . $term );
}

/**
* Update options after a previously shared taxonomy term is split into two separate terms.
*
* @since 1.10.7
*/
public function update_playlist_order_for_split_terms( $old_term_id, $new_term_id, $term_taxonomy_id, $taxonomy ) {
$playlist_order = get_option( 'playlist_' . $old_term_id );

// Check to see whether the stored tag ID is the one that's just been split.
if ( isset( $playlist_order ) && $old_term_id !== $new_term_id && 'playlist' == $taxonomy ) {
// We have a match, so we save a new option with the new id.
update_option( 'playlist_' . $new_term_id, $playlist_order );
delete_option( 'playlist_' . $old_term_id );
}
}

}
17 changes: 8 additions & 9 deletions admin/flowplayer-drive/class-flowplayer-drive.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,6 @@ protected function make_auth_request() {
*/
protected function make_video_request() {

$json_cache = get_transient( 'flowplayer_drive_json_cache' );

if ( false !== $json_cache ) {
return $json_cache;
}

$authcode = $this->make_auth_request();

$query_args = array(
Expand All @@ -144,9 +138,6 @@ protected function make_video_request() {
$json = $this->json_decode_body( $response );

if ( 200 == wp_remote_retrieve_response_code( $response ) ) {

set_transient( 'flowplayer_drive_json_cache', $json->account, 15 * MINUTE_IN_SECONDS );

return $json->account;
}

Expand All @@ -168,6 +159,12 @@ protected function make_video_request() {
*/
public function get_videos() {

$videos_cache = get_transient( 'flowplayer_drive_videos_cache' );

if ( false !== $videos_cache ) {
return $videos_cache;
}

$json = $this->make_video_request();

if ( empty( $json ) ) {
Expand Down Expand Up @@ -247,6 +244,8 @@ public function get_videos() {

}

set_transient( 'flowplayer_drive_videos_cache', $videos, 15 * MINUTE_IN_SECONDS );

return $videos;

}
Expand Down
2 changes: 1 addition & 1 deletion flowplayer.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* Plugin Name: Flowplayer HTML5 for WordPress
* Plugin URI: http://wordpress.org/plugins/flowplayer5/
* Description: A HTML5 responsive video player plugin. From the makers of Flowplayer. Includes player skins, tracking with Google Analytics, splash images and support for subtitles and multi-resolution videos. You can use your own watermark logo if you own a Commercial Flowplayer license.
* Version: 1.10.6
* Version: 1.10.7
* Author: Flowplayer ltd.
* Author URI: http://flowplayer.org/
* Text Domain: flowplayer5
Expand Down
29 changes: 18 additions & 11 deletions frontend/class-flowplayer5-frontend.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
*/
class Flowplayer5_Frontend {

public $has_flowplayer_video = '';

/**
* Initialize the plugin by setting localization, filters, and administration functions.
*
Expand Down Expand Up @@ -109,10 +107,9 @@ public function enqueue_styles() {
*/
public function enqueue_scripts() {

$options = get_option( 'fp5_settings_general' );
$asf_js = ( ! empty ( $options['asf_js'] ) ? $options['asf_js'] : false );
$is_multiresolution = $this->is_multiresolution();
$suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
$options = get_option( 'fp5_settings_general' );
$asf_js = ( ! empty ( $options['asf_js'] ) ? $options['asf_js'] : false );
$suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';

wp_register_script( $this->plugin_slug . '-script', trailingslashit( $this->flowplayer5_directory ) . 'flowplayer' . $suffix . '.js', array( 'jquery' ), $this->player_version, false );
wp_register_script( $this->plugin_slug . '-ima3', '//s0.2mdn.net/instream/html5/ima3.js', array(), null, false );
Expand All @@ -125,7 +122,8 @@ public function enqueue_scripts() {
if ( $asf_js ) {
wp_enqueue_script( $this->plugin_slug . '-asf' );
}
if ( $is_multiresolution ) {
$this->video_qualities();
if ( isset( $this->video_qualities ) ) {
wp_enqueue_script( $this->plugin_slug . '-quality-selector' );
}
}
Expand Down Expand Up @@ -232,7 +230,7 @@ public function has_flowplayer_shortcode() {
}

public function has_flowplayer_video() {
if ( ! empty( $this->has_flowplayer_video ) ){
if ( isset( $this->has_flowplayer_video ) ){
return;
}

Expand All @@ -247,25 +245,34 @@ public function has_flowplayer_video() {
$this->has_flowplayer_video = $has_video;
}

public function is_multiresolution() {
public function video_qualities() {

if ( isset( $this->video_qualities ) ){
return;
}

$post_id = '';
$qualities = array();

// Check if the post is a flowplayer video
if ( 'flowplayer5' == get_post_type() && isset ( $post->ID ) ) {
$post_id = $post->ID;
$qualities[] = get_post_meta( $post_id, 'fp5-qualities', true );
return $qualities;
$this->video_qualities = $qualities;
return;
}

$this->has_flowplayer_shortcode();
if ( empty( $this->has_flowplayer_shortcode ) ) {
return;
}
foreach ( $this->has_flowplayer_shortcode as $key => $value ) {
if ( 'id' . $value === $key ) {
$qualities[] = get_post_meta( $post_id, 'fp5-qualities', true );
}
}

return $qualities;
$this->video_qualities = $qualities;
}

}
8 changes: 8 additions & 0 deletions frontend/class-flowplayer5-output.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ public function video_output( $atts ) {
if ( isset( $atts['playlist'] ) ) {
$playlist_id = $atts['playlist'];
$playlist_options = get_option( 'playlist_' . absint( $playlist_id ) );
// Check if old id is being used in the shortcode
if ( ! $playlist_options && function_exists( 'wp_get_split_term' ) ) {
$new_term_id = wp_get_split_term( absint( $playlist_id ), 'playlist' );
$playlist_options = get_option( 'playlist_' . absint( $new_term_id ) );
if ( $playlist_options ) {
$playlist_id = $new_term_id;
}
}
if ( ! $playlist_options ) {
return;
}
Expand Down
2 changes: 1 addition & 1 deletion includes/class-flowplayer5.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class Flowplayer5 {
*
* @var string
*/
protected $plugin_version = '1.10.6';
protected $plugin_version = '1.10.7';

/**
* Player version, used for cache-busting of style and script file references.
Expand Down
10 changes: 9 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributors: flowplayerorg, grapplerulrich, anssi
Donate link: http://flowplayer.org/pricing/?utm_source=wordpress.org&utm_medium=readme&utm_campaign=Flowplayer%20Plugin
Tags: flowplayer, flowplayer5, Flowplayer HTML5, responsive, html5, video, player, rtmp, hls, flash, live-streaming, Flowplayer Drive, Adsense, video-widget
Requires at least: 3.5
Tested up to: 4.1.1
Tested up to: 4.2
Stable tag: trunk
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Expand Down Expand Up @@ -252,6 +252,11 @@ add_filter( 'fp5_post_meta_defaults', 'fp5_post_meta_defaults' );`

We have a lot of plans for this plugin. You can see some of the up and coming features in the [roadmap](https://github.com/flowplayer/wordpress-flowplayer/issues?labels=enhancement&page=1&state=open)

= 1.10.7 - 5 April 2015 =
* fix bug: foreach warning on 404 page
* prepare for taxonomy term splitting in WP 4.2
* Reduce cache size by chaching processed video array

= 1.10.6 - 7 March 2015 =
* fix bug: checking video id with nested shortcodes
* fix bug: Invalid argument supplied for foreach()
Expand Down Expand Up @@ -398,6 +403,9 @@ We have a lot of plans for this plugin. You can see some of the up and coming fe

== Upgrade Notice ==

= 1.10.7 =
* fix bugs and add support for WP 4.2

= 1.10.6 =
* fix bugs with playing videos

Expand Down

0 comments on commit 2dc511d

Please sign in to comment.