Plugin Directory

Changeset 1263459


Ignore:
Timestamp:
10/11/2015 12:12:39 PM (10 years ago)
Author:
insideout10
Message:

update to 1.2.0

Location:
helixware/trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • helixware/trunk/admin/helixware_admin.php

    r1108802 r1263459  
    1515    // Get the configuration options.
    1616    $options = array(
    17         'url'         => hewa_get_option( HEWA_SETTINGS_SERVER_URL ) . '/4/user/ondemand',
     17        'url'         => hewa_get_server_url() . '/4/user/ondemand',
    1818        'key'         => hewa_get_option( HEWA_SETTINGS_APPLICATION_KEY ),
    1919        'secret'      => hewa_get_option( HEWA_SETTINGS_APPLICATION_SECRET ),
  • helixware/trunk/admin/helixware_admin_metaboxes.php

    r1108802 r1263459  
    3232    wp_nonce_field( 'hewa_admin_metabox_clip_ingest', 'hewa_admin_metabox_clip_ingest_nonce' );
    3333
    34     $url_j        = json_encode( hewa_get_option( HEWA_SETTINGS_SERVER_URL ) . '/4/users/files' );
     34    $url_j        = json_encode( hewa_get_server_url() . '/4/users/files' );
    3535    $app_key_j    = json_encode( hewa_get_option( HEWA_SETTINGS_APPLICATION_KEY ) );
    3636    $app_secret_j = json_encode( hewa_get_option( HEWA_SETTINGS_APPLICATION_SECRET ) );
  • helixware/trunk/admin/helixware_admin_settings_player.php

    r1108802 r1263459  
    88function hewa_admin_settings_player_section_callback() {
    99
    10     echo '<p>' .
    11         esc_html__( 'Configure the player settings.' ) .
    12         '</p>';
     10    echo '<p>' .
     11         esc_html__( 'Configure the player settings.' ) .
     12         '</p>';
    1313
    1414}
     
    1616function hewa_admin_settings_player_section() {
    1717
    18     register_setting( HEWA_OPTIONS_SETTINGS_PLAYER, HEWA_OPTIONS_SETTINGS_PLAYER );
     18    register_setting( HEWA_OPTIONS_SETTINGS_PLAYER, HEWA_OPTIONS_SETTINGS_PLAYER );
    1919
    20     // Add the general section.
    21     add_settings_section(
    22         HEWA_OPTIONS_SETTINGS_PLAYER,
    23         'Player Settings',
    24         'hewa_admin_settings_player_section_callback',
    25         HEWA_OPTIONS_SETTINGS_PLAYER
    26     );
     20    // Add the general section.
     21    add_settings_section(
     22        HEWA_OPTIONS_SETTINGS_PLAYER,
     23        'Player Settings',
     24        'hewa_admin_settings_player_section_callback',
     25        HEWA_OPTIONS_SETTINGS_PLAYER
     26    );
    2727
    2828
    29     hewa_admin_settings_add_field(
    30         HEWA_SETTINGS_TEMPLATE_ID, __( 'Template Id', HEWA_LANGUAGE_DOMAIN ), 'hewa_admin_settings_select_page'
    31     );
     29    hewa_admin_settings_add_field(
     30        HEWA_SETTINGS_TEMPLATE_ID, __( 'Template Id', HEWA_LANGUAGE_DOMAIN ), 'hewa_admin_settings_select_page'
     31    );
    3232
    33     hewa_admin_settings_add_field(
    34         HEWA_SETTINGS_JWPLAYER_ID, __( 'JWPlayer Key', HEWA_LANGUAGE_DOMAIN ), 'hewa_admin_settings_input_text'
    35     );
     33    hewa_admin_settings_add_field(
     34        HEWA_SETTINGS_JWPLAYER_ID, __( 'JWPlayer 6 Key', HEWA_LANGUAGE_DOMAIN ), 'hewa_admin_settings_input_text'
     35    );
    3636
    37     hewa_admin_settings_add_field(
    38         HEWA_SETTINGS_JWPLAYER_DEFAULT_SKIN, __( 'JWPlayer Default Skin', HEWA_LANGUAGE_DOMAIN ), 'hewa_admin_settings_input_text'
    39     );
     37    hewa_admin_settings_add_field(
     38        HEWA_SETTINGS_JWPLAYER_DEFAULT_SKIN, __( 'JWPlayer Default Skin', HEWA_LANGUAGE_DOMAIN ), 'hewa_admin_settings_input_text'
     39    );
    4040
    41     hewa_admin_settings_add_field(
    42         HEWA_SETTINGS_JWPLAYER_LOGO_URL, __( 'JWPlayer Logo', HEWA_LANGUAGE_DOMAIN ), 'hewa_admin_settings_input_text'
    43     );
     41    hewa_admin_settings_add_field(
     42        HEWA_SETTINGS_JWPLAYER_LOGO_URL, __( 'JWPlayer Logo', HEWA_LANGUAGE_DOMAIN ), 'hewa_admin_settings_input_text'
     43    );
    4444
    45     hewa_admin_settings_add_field(
    46         HEWA_SETTINGS_JWPLAYER_LOGO_LINK, __( 'JWPlayer Logo Link', HEWA_LANGUAGE_DOMAIN ), 'hewa_admin_settings_input_text'
    47     );
     45    hewa_admin_settings_add_field(
     46        HEWA_SETTINGS_JWPLAYER_LOGO_LINK, __( 'JWPlayer Logo Link', HEWA_LANGUAGE_DOMAIN ), 'hewa_admin_settings_input_text'
     47    );
     48
     49    hewa_admin_settings_add_field(
     50        HEWA_SETTINGS_JWPLAYER_7_KEY, __( 'JWPlayer 7 Key', HEWA_LANGUAGE_DOMAIN ), 'hewa_admin_settings_input_text'
     51    );
    4852
    4953}
  • helixware/trunk/admin/helixware_admin_settings_server.php

    r1108802 r1263459  
    99
    1010    echo '<p>' .
    11          esc_html__( 'Set here the basic settings for HelixWare including the URL for HelixWare Server and the application data.' ) .
     11         esc_html__( 'Set here the basic settings for HelixWare.' ) .
    1212         '</p>';
    1313
     
    2626    );
    2727
    28     hewa_admin_settings_add_field(
    29         HEWA_SETTINGS_SERVER_URL,
    30         __( 'HelixWare Server URL', HEWA_LANGUAGE_DOMAIN ),
    31         'hewa_admin_settings_input_text',
    32         null,
    33         'https://cloud.helixware.tv'
    34     );
     28//  hewa_admin_settings_add_field(
     29//      HEWA_SETTINGS_SERVER_URL,
     30//      __( 'HelixWare Server URL', HEWA_LANGUAGE_DOMAIN ),
     31//      'hewa_admin_settings_input_text',
     32//      null,
     33//      'https://cloud.helixware.tv'
     34//  );
    3535
    3636//  hewa_admin_settings_add_field(
  • helixware/trunk/ajax/helixware_ajax_rss.php

    r1108802 r1263459  
    1717function hewa_ajax_load_rss() {
    1818
    19     // Check if the asset id has been provided.
    20     if ( ! isset( $_GET['id'] ) || empty( $_GET['id'] ) ) {
    21         wp_die( __( 'The id parameter is required.', HEWA_LANGUAGE_DOMAIN ) );
    22     }
     19    // Check if the asset id has been provided.
     20    if ( ! isset( $_GET['id'] ) || empty( $_GET['id'] ) ) {
     21        wp_die( __( 'The id parameter is required.', HEWA_LANGUAGE_DOMAIN ) );
     22    }
    2323
    24     $asset_id  = $_GET['id'];
    25     $title     = ( isset( $_GET['t'] ) ? $_GET['t'] : '' );
    26     $image_url = ( isset( $_GET['i'] ) ? $_GET['i'] : '' );
    27     $order_by  = ( isset( $_GET['ob'] ) ? $_GET['ob'] : 'date' );
    28     $order     = ( isset( $_GET['o'] ) ? $_GET['o'] : 'desc' );
    29     $streams   = hewa_get_clip_urls( $asset_id );
     24    $asset_id  = $_GET['id'];
     25    $title     = ( isset( $_GET['t'] ) ? $_GET['t'] : '' );
     26    $image_url = ( isset( $_GET['i'] ) ? $_GET['i'] : '' );
     27    $order_by  = ( isset( $_GET['ob'] ) ? $_GET['ob'] : 'date' );
     28    $order     = ( isset( $_GET['o'] ) ? $_GET['o'] : 'desc' );
     29    $streams   = hewa_get_clip_urls( $asset_id );
    3030
    31     $m3u8      = $streams->formats->{'m3u8-redirector'};
     31    $m3u8 = $streams->formats->{'m3u8-redirector'};
    3232
    3333
    34     ob_start();
    35     header( "Content-Type: application/rss+xml" );
     34    ob_start();
     35    header( "Content-Type: application/rss+xml" );
    3636
    37     echo <<<EOF
     37    echo <<<EOF
    3838<rss version="2.0" xmlns:jwplayer="http://rss.jwpcdn.com/">
    3939 <channel>
     
    4141EOF;
    4242
    43     hewa_echo_rss_item( $asset_id, $m3u8, $title, $image_url );
     43    hewa_echo_rss_item( $asset_id, $m3u8, $title, $image_url );
    4444
    45     // Add a list for the listbar if we have a category.
    46     if ( isset( $_GET['cat'] ) ) {
     45    // Add a list for the listbar if we have a category.
     46    if ( isset( $_GET['cat'] ) ) {
    4747
    48         // Get the category Id.
    49         $category_id = ( is_numeric( $_GET['cat'] ) ? $_GET['cat'] : get_category_by_slug( $_GET['cat'] )->cat_ID );
    50         $posts_count = ( isset( $_GET['max'] ) && is_numeric( $_GET['max'] ) ? $_GET['max'] : 5 );
     48        // Get the category Id.
     49        $category_id = ( is_numeric( $_GET['cat'] ) ? $_GET['cat'] : get_category_by_slug( $_GET['cat'] )->cat_ID );
     50        $posts_count = ( isset( $_GET['max'] ) && is_numeric( $_GET['max'] ) ? $_GET['max'] : 5 );
    5151
    52         // Query for posts.
    53         $posts      = get_posts( array(
    54             'category'       => $category_id,
    55             'posts_per_page' => $posts_count,
    56             'numberposts'    => $posts_count,
    57             'order_by'       => $order_by,
    58             'order'          => $order
    59         ) );
     52        // Query for posts.
     53        $posts = get_posts( array(
     54            'category'       => $category_id,
     55            'posts_per_page' => $posts_count,
     56            'numberposts'    => $posts_count,
     57            'order_by'       => $order_by,
     58            'order'          => $order
     59        ) );
    6060
    61         foreach ( $posts as $post ) {
     61        foreach ( $posts as $post ) {
    6262
    63             $matches = array();
    64             if ( 1 === preg_match( '/ asset_id=(\d+)/', $post->post_content, $matches ) ) {
     63            $matches = array();
     64            if ( 1 === preg_match( '/ asset_id=(\d+)/', $post->post_content, $matches ) ) {
    6565
    66                 $this_asset_id = $matches[1];
     66                $this_asset_id = $matches[1];
    6767
    68                 // Don't add the same asset.
    69                 if ( $asset_id === $this_asset_id ) {
    70                     continue;
    71                 }
     68                // Don't add the same asset.
     69                if ( $asset_id === $this_asset_id ) {
     70                    continue;
     71                }
    7272
    73                 $thumbnail_id  = get_post_thumbnail_id( $post->ID );
    74                 // TODO: get attachment of the required size.
    75                 $attachment_url = wp_get_attachment_url( $thumbnail_id );
    76                 hewa_echo_rss_item( $this_asset_id, null, $post->post_title, $attachment_url );
     73                $thumbnail_id = get_post_thumbnail_id( $post->ID );
     74                // TODO: get attachment of the required size.
     75                $attachment_url = wp_get_attachment_url( $thumbnail_id );
     76                hewa_echo_rss_item( $this_asset_id, NULL, $post->post_title, $attachment_url, $post->ID );
    7777
    78             }
    79         }
     78            }
     79        }
    8080
    81     }
     81    }
    8282
    83     echo <<<EOF
     83    echo <<<EOF
    8484 </channel>
    8585</rss>
     
    8787
    8888
    89     wp_die();
     89    wp_die();
    9090
    9191}
     92
    9293add_action( 'wp_ajax_hewa_rss', 'hewa_ajax_load_rss' );
    9394add_action( 'wp_ajax_nopriv_hewa_rss', 'hewa_ajax_load_rss' );
    9495
    9596
    96 function hewa_echo_rss_item( $asset_id, $m3u8 = null, $title = null, $image_url = null ) {
     97function hewa_echo_rss_item( $asset_id, $m3u8 = NULL, $title = NULL, $image_url = NULL, $post_id = NULL ) {
    9798
    98     // Get the ajax URL.
    99     $ajax_url = admin_url( 'admin-ajax.php' );
     99    // Get the ajax URL.
     100    $ajax_url = admin_url( 'admin-ajax.php' );
    100101
    101     echo "  <item>\n";
     102    echo "  <item>\n";
    102103
    103     if ( null !== $title ) {
     104    if ( NULL !== $title ) {
    104105
    105         // Escape the title.
    106         $title_h = esc_html( $title );
    107         echo "   <title>$title_h</title>\n";
     106        // Escape the title.
     107        $title_h = esc_html( $title );
     108        echo "   <title>$title_h</title>\n";
    108109
    109     }
     110    }
    110111
    111     if ( null !== $image_url && ! empty( $image_url ) ) {
    112         echo "   <jwplayer:image>$image_url</jwplayer:image>\n";
    113     }
     112    if ( NULL !== $image_url && ! empty( $image_url ) ) {
     113        echo "   <jwplayer:image>$image_url</jwplayer:image>\n";
     114    }
    114115
    115116    // TODO: make the following URL parametric and use the authenticated PHP call.
    116     $server_url = hewa_get_option( HEWA_SETTINGS_SERVER_URL, '' );
     117    $server_url   = hewa_get_server_url();
     118    $chapters_url = admin_url( 'admin-ajax.php?action=hw_vtt_chapters&id=' . $post_id );
    117119
    118120    echo "   <jwplayer:source file=\"$server_url/4/pub/asset/$asset_id/streams.smil\" label=\"Auto\" type=\"rtmp\" />\n";
    119     echo "   <jwplayer:source file=\"$server_url/4/pub/asset/$asset_id/streams.m3u8\" label=\"Auto\" default=\"true\" type=\"hls\" />\n";
    120     echo "   <jwplayer:track file=\"$server_url/4/pub/asset/$asset_id/vtt?w=95&amp;i=5\" kind=\"thumbnails\" />\n";
     121    echo "   <jwplayer:source file=\"$server_url/4/pub/asset/$asset_id/streams.m3u8\" label=\"Auto\" default=\"true\" type=\"hls\" />\n";
     122    echo "   <jwplayer:track file=\"$server_url/4/pub/asset/$asset_id/vtt?w=95&amp;i=5\" kind=\"thumbnails\" />\n";
     123    echo "   <jwplayer:track file=\"$chapters_url\" kind=\"chapters\" />\n";
    121124
    122125
    123     // Print if there are m3u8 files and the client is not an Android.
    124     if ( null !== $m3u8  && false === stripos( $_SERVER['HTTP_USER_AGENT'], 'Android' ) ) {
     126    // Print if there are m3u8 files and the client is not an Android.
     127    if ( NULL !== $m3u8 && FALSE === stripos( $_SERVER['HTTP_USER_AGENT'], 'Android' ) ) {
    125128
    126         // Sort the bitrates.
    127         $bitrates = $m3u8->bitrates;
    128         usort( $bitrates, function( $a, $b ) { return $a->bitrate - $b->bitrate; } );
     129        // Sort the bitrates.
     130        $bitrates = $m3u8->bitrates;
     131        usort( $bitrates, function ( $a, $b ) {
     132            return $a->bitrate - $b->bitrate;
     133        } );
    129134
    130         for ( $i = 0; $i < sizeof( $bitrates ); $i++ ) {
     135        for ( $i = 0; $i < sizeof( $bitrates ); $i ++ ) {
    131136
    132             $bitrate    = $bitrates[$i];
    133             $width_p    = $bitrate->width . 'p';
    134             $url        = $bitrate->url;
     137            $bitrate = $bitrates[ $i ];
     138            $width_p = $bitrate->width . 'p';
     139            $url     = $bitrate->url;
    135140
    136             echo "   <jwplayer:source file=\"$url\" label=\"$width_p\" type=\"hls\" />\n";
     141            echo "   <jwplayer:source file=\"$url\" label=\"$width_p\" type=\"hls\" />\n";
    137142
    138         }
    139     }
     143        }
     144    }
    140145
    141     echo "</item>";
     146    echo "</item>";
    142147
    143148}
  • helixware/trunk/helixware.php

    r1109484 r1263459  
    1717
    1818/**
    19  * Plugin Name: HelixWare
    20  * Plugin URI: http://helixware.tv
    21  * Description: HelixWare turns WordPress in a Video web site
    22  * Version: 1.0.0
    23  * Author: InsideOut10
    24  * Author URI: http://helixware.tv
    25  * License: GPL2
     19 * @link              http://helixware.tv
     20 * @since             1.0.0
     21 * @package           HelixWare
     22 *
     23 * @wordpress-plugin
     24 * Plugin Name:       HelixWare
     25 * Plugin URI:        http://helixware.tv
     26 * Description:       HelixWare turns WordPress in a Video web site
     27 * Version:           1.2.0
     28 * Author:            InsideOut10
     29 * Author URI:        http://helixware.tv
     30 * License:           GPL-2.0+
     31 * License URI:       http://www.gnu.org/licenses/gpl-2.0.txt
     32 * Text Domain:       helixware
     33 * Domain Path:       /languages
    2634 */
    2735
     
    8088
    8189require_once( 'modules/seo/seo.php' );
     90
     91
     92// If this file is called directly, abort.
     93if ( ! defined( 'WPINC' ) ) {
     94    die;
     95}
     96
     97// Get the HelixWare server URL.
     98defined( 'HELIXWARE_SERVER_URL' ) || define( 'HELIXWARE_SERVER_URL', 'https://cloud.helixware.tv' );
     99
     100/**
     101 * The code that runs during plugin activation.
     102 * This action is documented in includes/class-helixware-activator.php
     103 */
     104function activate_helixware() {
     105    require_once plugin_dir_path( __FILE__ ) . 'includes/class-helixware-activator.php';
     106    HelixWare_Activator::activate();
     107}
     108
     109/**
     110 * The code that runs during plugin deactivation.
     111 * This action is documented in includes/class-helixware-deactivator.php
     112 */
     113function deactivate_helixware() {
     114    require_once plugin_dir_path( __FILE__ ) . 'includes/class-helixware-deactivator.php';
     115    HelixWare_Deactivator::deactivate();
     116}
     117
     118register_activation_hook( __FILE__, 'activate_helixware' );
     119register_deactivation_hook( __FILE__, 'deactivate_helixware' );
     120
     121/**
     122 * The core plugin class that is used to define internationalization,
     123 * admin-specific hooks, and public-facing site hooks.
     124 */
     125require plugin_dir_path( __FILE__ ) . 'includes/class-helixware.php';
     126
     127/**
     128 * Begins execution of the plugin.
     129 *
     130 * Since everything within the plugin is registered via hooks,
     131 * then kicking off the plugin from this point in the file does
     132 * not affect the page life cycle.
     133 *
     134 * @since    1.0.0
     135 */
     136function run_helixware() {
     137
     138    $plugin = new HelixWare();
     139    $plugin->run();
     140
     141}
     142
     143run_helixware();
  • helixware/trunk/helixware_constants.php

    r1108802 r1263459  
    2323define( 'HEWA_SETTINGS_STREAMING_SERVER', HEWA_OPTIONS_SETTINGS_SERVER . '>hewa_streaming_server' );
    2424define( 'HEWA_SETTINGS_STREAMING_PROTOCOL', HEWA_OPTIONS_SETTINGS_SERVER . '>hewa_streaming_protocol' );
    25 define( 'HEWA_SETTINGS_SERVER_URL', HEWA_OPTIONS_SETTINGS_SERVER . '>hewa_server_url' );
     25//define( 'HEWA_SETTINGS_SERVER_URL', HEWA_OPTIONS_SETTINGS_SERVER . '>hewa_server_url' );
    2626define( 'HEWA_SETTINGS_APPLICATION_KEY', HEWA_OPTIONS_SETTINGS_SERVER . '>hewa_app_key' );
    2727define( 'HEWA_SETTINGS_APPLICATION_SECRET', HEWA_OPTIONS_SETTINGS_SERVER . '>hewa_app_secret' );
     
    3131define( 'HEWA_SETTINGS_JWPLAYER_LOGO_LINK', HEWA_OPTIONS_SETTINGS_PLAYER . '>hewa_jwplayer_logo_link' );
    3232define( 'HEWA_SETTINGS_JWPLAYER_DEFAULT_SKIN', HEWA_OPTIONS_SETTINGS_PLAYER . '>hewa_jwplayer_default_skin' );
     33define( 'HEWA_SETTINGS_JWPLAYER_7_KEY', HEWA_OPTIONS_SETTINGS_PLAYER . '>hewa_jwplayer_7_key' );
    3334
    3435// The value is handled in the code in *hewa_get_option*.
     
    4041
    4142define( 'HEWA_API_HTTP_OPTIONS', serialize( array(
    42     'timeout' => 300,
    43     'redirection' => 5,
    44     'httpversion' => '1.0',
    45     'blocking' => true,
    46     'cookies' => array(),
    47     'sslverify' => false
     43    'timeout'    => 300,
     44    'redirection' => 5,
     45    'httpversion' => '1.0',
     46    'blocking'    => TRUE,
     47    'cookies'    => array(),
     48    'sslverify'   => FALSE
    4849) ) );
    4950
  • helixware/trunk/helixware_server.php

    r1108802 r1263459  
    2323    // Get the configuration settings and die if not set.
    2424    $server_url = hewa_get_server_url();
    25     $app_key    = hewa_get_option( HEWA_SETTINGS_APPLICATION_KEY, false );
    26     $app_secret = hewa_get_option( HEWA_SETTINGS_APPLICATION_SECRET, false );
     25    $app_key    = hewa_get_option( HEWA_SETTINGS_APPLICATION_KEY, FALSE );
     26    $app_secret = hewa_get_option( HEWA_SETTINGS_APPLICATION_SECRET, FALSE );
    2727
    28     if ( false === $server_url || false === $app_key || false === $app_secret ) {
     28    if ( FALSE === $server_url || FALSE === $app_key || FALSE === $app_secret ) {
    2929        wp_die( __( 'The plugin is not configured.', HEWA_LANGUAGE_DOMAIN ) );
    3030    }
     
    102102function hewa_get_server_url() {
    103103
    104     return hewa_get_option( HEWA_SETTINGS_SERVER_URL, false );
     104    return HELIXWARE_SERVER_URL;
     105
    105106}
  • helixware/trunk/readme.txt

    r1109485 r1263459  
    11=== Plugin Name ===
    2 Contributors: insideout10
    3 Tags: video, streaming, SEO, audio, HLS, Flash
    4 Requires at least: 4.0
    5 Tested up to: 4.1.1
    6 Stable tag: 1.0.0
     2Contributors: insideout10, ziodave
     3Tags: video, streaming, ondemand, SEO, audio, HLS, Flash, OTT, DASH, rtsp
     4Requires at least: 4.3
     5Tested up to: 4.3.1
     6Stable tag: 1.1.0
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    3939== Changelog ==
    4040
     41= 1.2.0 (2015-10-11) =
     42
     43* add support for JWPlayer 7; do not include non-GPL files with the plugin and use CDN for JWPlayer [#15](https://github.com/insideout10/helixware-plugin/issues/15)
     44* add support for MICO extensions, temporal video segmentation [#20](https://github.com/insideout10/helixware-plugin/issues/20)
     45
     46= 1.1.0 (2015-10-04) =
     47
     48* WordPress Media Library integration [#10](https://github.com/insideout10/helixware-plugin/issues/10)
     49* Media Library synchronization happens only when WP requests the list of attachments [#18](https://github.com/insideout10/helixware-plugin/issues/18)
     50
    4151= 1.0.0 =
     52
    4253* First release.
  • helixware/trunk/shortcodes/helixware_shortcode_player.php

    r1108802 r1263459  
    2020    // TODO: default width and height ratio should be calculated from the video.
    2121    $params = shortcode_atts( array(
    22         'width'        => '100%', // by default we stretch the full width of the containing element.
    23         'asset_id'     => null,
    24         'live_id'      => null,
     22        'width'        => '100%',
     23        // by default we stretch the full width of the containing element.
     24        'asset_id'     => NULL,
     25        'live_id'      => NULL,
    2526        'aspectratio'  => '5:3',
    26         'listbar'      => null,
     27        'listbar'      => NULL,
    2728        'listbar_size' => 240,
    2829        'listbar_cat'  => 'for-you',
    29         'autostart'    => true,
     30        'autostart'    => TRUE,
    3031        'max'          => 5,
    3132        'skin'         => hewa_get_option( HEWA_SETTINGS_JWPLAYER_DEFAULT_SKIN, '' ),
     
    5354    // Build the player array which will then be translated to JavaScript for JWPlayer initialization.
    5455    $player                = array();
    55     $player['flashplayer'] = plugins_url( 'js/jwplayer-6.11/jwplayer.flash.swf', __FILE__ );
    56     $player['html5player'] = plugins_url( 'js/jwplayer-6.11/jwplayer.html5.js', __FILE__ );
    57     $player['androidhls']  = true;
     56//  $player['flashplayer'] = plugins_url( 'js/jwplayer-6.11/jwplayer.flash.swf', __FILE__ );
     57//  $player['html5player'] = plugins_url( 'js/jwplayer-6.11/jwplayer.html5.js', __FILE__ );
     58    $player['androidhls']  = TRUE;
    5859    $player['autostart']   = ( $params['autostart'] && is_singular() ? 'true' : 'false' );
    59     $player['playlist']    = ( $is_live || null === $params['listbar']
    60         ? hewa_get_option( HEWA_SETTINGS_SERVER_URL, false ) . "/4/pub/asset/$asset_id/streams.xml"
     60    $player['playlist']    = ( $is_live || NULL === $params['listbar']
     61        ? hewa_get_server_url() . "/4/pub/asset/$asset_id/streams.xml"
    6162        : apply_filters( HEWA_FILTERS_PLAYER_PLAYLIST_URL,
    6263            admin_url( 'admin-ajax.php?action=hewa_rss&id=' . $asset_id .
     
    6465                       '&i=' . $image_u . // set the image
    6566                       '&max=' . $params['max'] . // set the maximum number of elements
    66                        ( null !== $params['listbar'] ? '&cat=' . $params['listbar_cat'] : '' ) // add the category if we have the listbar.
     67                       ( NULL !== $params['listbar'] ? '&cat=' . $params['listbar_cat'] : '' ) // add the category if we have the listbar.
    6768            )
    6869        ) );
     
    7172    $player['ga']          = array(
    7273        // playlist title or mediaid
    73         'idstring'    => ( null != $params['ga_id_string'] ? $params['ga_id_string'] : 'mediaid' ),
    74         'universalga' => ( null != $params['ga_tracking_object'] ? $params['ga_tracking_object'] : '__gaTracker' ),
     74        'idstring'    => ( NULL != $params['ga_id_string'] ? $params['ga_id_string'] : 'mediaid' ),
     75        'universalga' => ( NULL != $params['ga_tracking_object'] ? $params['ga_tracking_object'] : '__gaTracker' ),
    7576        // mediaid or title
    76         'label'       => ( null != $params['ga_media_id'] ? $params['ga_media_id'] : 'title' )
     77        'label'       => ( NULL != $params['ga_media_id'] ? $params['ga_media_id'] : 'title' )
    7778    );
    7879
     
    9798
    9899    // Build the *responsive* listbar.
    99     if ( null !== $params['listbar'] && 'responsive' === $params['listbar'] ) {
     100    if ( NULL !== $params['listbar'] && 'responsive' === $params['listbar'] ) {
    100101        wp_enqueue_style( 'helixware-player-css', plugins_url( 'css/helixware.player.css', dirname( __FILE__ ) ) );
    101102
     
    116117
    117118    // Build a standard listbar.
    118     if ( null !== $params['listbar'] && 'responsive' !== $params['listbar'] ) {
     119    if ( NULL !== $params['listbar'] && 'responsive' !== $params['listbar'] ) {
    119120
    120121        $player['listbar'] = array(
     
    129130
    130131    // Start printing out the player javascript.
    131     $jwplayer_url = plugins_url( 'js/jwplayer-6.11/jwplayer.js', __FILE__ );
     132
     133    wp_enqueue_script( 'jwplayer6', sprintf( HelixWare_Player_JWPlayer6::LIBRARY_URL, $jwplayer_key ) );
    132134    $result .= <<<EOF
    133135        <script type="text/javascript">
    134136            jQuery( function( $ ) {
    135                 $.getScript('$jwplayer_url', function() {
    136 
    137                 jwplayer.key = '$jwplayer_key';
    138                 jwplayer('$player_id')
    139                     .setup($player_json);
     137
     138                jwplayer('$player_id').setup($player_json);
    140139
    141140EOF;
     
    201200
    202201    // Close the script and return the results.
    203     return $result . '}); });</script>';
     202    return $result . '});</script>';
    204203
    205204}
Note: See TracChangeset for help on using the changeset viewer.