Changeset 1263459
- Timestamp:
- 10/11/2015 12:12:39 PM (10 years ago)
- Location:
- helixware/trunk
- Files:
-
- 10 edited
-
admin/helixware_admin.php (modified) (1 diff)
-
admin/helixware_admin_metaboxes.php (modified) (1 diff)
-
admin/helixware_admin_settings_player.php (modified) (2 diffs)
-
admin/helixware_admin_settings_server.php (modified) (2 diffs)
-
ajax/helixware_ajax_rss.php (modified) (3 diffs)
-
helixware.php (modified) (2 diffs)
-
helixware_constants.php (modified) (3 diffs)
-
helixware_server.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
-
shortcodes/helixware_shortcode_player.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
helixware/trunk/admin/helixware_admin.php
r1108802 r1263459 15 15 // Get the configuration options. 16 16 $options = array( 17 'url' => hewa_get_ option( HEWA_SETTINGS_SERVER_URL) . '/4/user/ondemand',17 'url' => hewa_get_server_url() . '/4/user/ondemand', 18 18 'key' => hewa_get_option( HEWA_SETTINGS_APPLICATION_KEY ), 19 19 'secret' => hewa_get_option( HEWA_SETTINGS_APPLICATION_SECRET ), -
helixware/trunk/admin/helixware_admin_metaboxes.php
r1108802 r1263459 32 32 wp_nonce_field( 'hewa_admin_metabox_clip_ingest', 'hewa_admin_metabox_clip_ingest_nonce' ); 33 33 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' ); 35 35 $app_key_j = json_encode( hewa_get_option( HEWA_SETTINGS_APPLICATION_KEY ) ); 36 36 $app_secret_j = json_encode( hewa_get_option( HEWA_SETTINGS_APPLICATION_SECRET ) ); -
helixware/trunk/admin/helixware_admin_settings_player.php
r1108802 r1263459 8 8 function hewa_admin_settings_player_section_callback() { 9 9 10 echo '<p>' .11 esc_html__( 'Configure the player settings.' ) .12 '</p>';10 echo '<p>' . 11 esc_html__( 'Configure the player settings.' ) . 12 '</p>'; 13 13 14 14 } … … 16 16 function hewa_admin_settings_player_section() { 17 17 18 register_setting( HEWA_OPTIONS_SETTINGS_PLAYER, HEWA_OPTIONS_SETTINGS_PLAYER );18 register_setting( HEWA_OPTIONS_SETTINGS_PLAYER, HEWA_OPTIONS_SETTINGS_PLAYER ); 19 19 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_PLAYER26 );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 ); 27 27 28 28 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 ); 32 32 33 hewa_admin_settings_add_field(34 HEWA_SETTINGS_JWPLAYER_ID, __( 'JWPlayerKey', 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 ); 36 36 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 ); 40 40 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 ); 44 44 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 ); 48 52 49 53 } -
helixware/trunk/admin/helixware_admin_settings_server.php
r1108802 r1263459 9 9 10 10 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.' ) . 12 12 '</p>'; 13 13 … … 26 26 ); 27 27 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 // ); 35 35 36 36 // hewa_admin_settings_add_field( -
helixware/trunk/ajax/helixware_ajax_rss.php
r1108802 r1263459 17 17 function hewa_ajax_load_rss() { 18 18 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 } 23 23 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 ); 30 30 31 $m3u8= $streams->formats->{'m3u8-redirector'};31 $m3u8 = $streams->formats->{'m3u8-redirector'}; 32 32 33 33 34 ob_start();35 header( "Content-Type: application/rss+xml" );34 ob_start(); 35 header( "Content-Type: application/rss+xml" ); 36 36 37 echo <<<EOF37 echo <<<EOF 38 38 <rss version="2.0" xmlns:jwplayer="http://rss.jwpcdn.com/"> 39 39 <channel> … … 41 41 EOF; 42 42 43 hewa_echo_rss_item( $asset_id, $m3u8, $title, $image_url );43 hewa_echo_rss_item( $asset_id, $m3u8, $title, $image_url ); 44 44 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'] ) ) { 47 47 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 ); 51 51 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' => $order59 ) );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 ) ); 60 60 61 foreach ( $posts as $post ) {61 foreach ( $posts as $post ) { 62 62 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 ) ) { 65 65 66 $this_asset_id = $matches[1];66 $this_asset_id = $matches[1]; 67 67 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 } 72 72 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 ); 77 77 78 }79 }78 } 79 } 80 80 81 }81 } 82 82 83 echo <<<EOF83 echo <<<EOF 84 84 </channel> 85 85 </rss> … … 87 87 88 88 89 wp_die();89 wp_die(); 90 90 91 91 } 92 92 93 add_action( 'wp_ajax_hewa_rss', 'hewa_ajax_load_rss' ); 93 94 add_action( 'wp_ajax_nopriv_hewa_rss', 'hewa_ajax_load_rss' ); 94 95 95 96 96 function hewa_echo_rss_item( $asset_id, $m3u8 = null, $title = null, $image_url = null) {97 function hewa_echo_rss_item( $asset_id, $m3u8 = NULL, $title = NULL, $image_url = NULL, $post_id = NULL ) { 97 98 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' ); 100 101 101 echo " <item>\n";102 echo " <item>\n"; 102 103 103 if ( null!== $title ) {104 if ( NULL !== $title ) { 104 105 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"; 108 109 109 }110 } 110 111 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 } 114 115 115 116 // 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 ); 117 119 118 120 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&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&i=5\" kind=\"thumbnails\" />\n"; 123 echo " <jwplayer:track file=\"$chapters_url\" kind=\"chapters\" />\n"; 121 124 122 125 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' ) ) { 125 128 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 } ); 129 134 130 for ( $i = 0; $i < sizeof( $bitrates ); $i++ ) {135 for ( $i = 0; $i < sizeof( $bitrates ); $i ++ ) { 131 136 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; 135 140 136 echo " <jwplayer:source file=\"$url\" label=\"$width_p\" type=\"hls\" />\n";141 echo " <jwplayer:source file=\"$url\" label=\"$width_p\" type=\"hls\" />\n"; 137 142 138 }139 }143 } 144 } 140 145 141 echo "</item>";146 echo "</item>"; 142 147 143 148 } -
helixware/trunk/helixware.php
r1109484 r1263459 17 17 18 18 /** 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 26 34 */ 27 35 … … 80 88 81 89 require_once( 'modules/seo/seo.php' ); 90 91 92 // If this file is called directly, abort. 93 if ( ! defined( 'WPINC' ) ) { 94 die; 95 } 96 97 // Get the HelixWare server URL. 98 defined( '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 */ 104 function 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 */ 113 function deactivate_helixware() { 114 require_once plugin_dir_path( __FILE__ ) . 'includes/class-helixware-deactivator.php'; 115 HelixWare_Deactivator::deactivate(); 116 } 117 118 register_activation_hook( __FILE__, 'activate_helixware' ); 119 register_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 */ 125 require 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 */ 136 function run_helixware() { 137 138 $plugin = new HelixWare(); 139 $plugin->run(); 140 141 } 142 143 run_helixware(); -
helixware/trunk/helixware_constants.php
r1108802 r1263459 23 23 define( 'HEWA_SETTINGS_STREAMING_SERVER', HEWA_OPTIONS_SETTINGS_SERVER . '>hewa_streaming_server' ); 24 24 define( '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' ); 26 26 define( 'HEWA_SETTINGS_APPLICATION_KEY', HEWA_OPTIONS_SETTINGS_SERVER . '>hewa_app_key' ); 27 27 define( 'HEWA_SETTINGS_APPLICATION_SECRET', HEWA_OPTIONS_SETTINGS_SERVER . '>hewa_app_secret' ); … … 31 31 define( 'HEWA_SETTINGS_JWPLAYER_LOGO_LINK', HEWA_OPTIONS_SETTINGS_PLAYER . '>hewa_jwplayer_logo_link' ); 32 32 define( 'HEWA_SETTINGS_JWPLAYER_DEFAULT_SKIN', HEWA_OPTIONS_SETTINGS_PLAYER . '>hewa_jwplayer_default_skin' ); 33 define( 'HEWA_SETTINGS_JWPLAYER_7_KEY', HEWA_OPTIONS_SETTINGS_PLAYER . '>hewa_jwplayer_7_key' ); 33 34 34 35 // The value is handled in the code in *hewa_get_option*. … … 40 41 41 42 define( '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 48 49 ) ) ); 49 50 -
helixware/trunk/helixware_server.php
r1108802 r1263459 23 23 // Get the configuration settings and die if not set. 24 24 $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 ); 27 27 28 if ( false === $server_url || false === $app_key || false=== $app_secret ) {28 if ( FALSE === $server_url || FALSE === $app_key || FALSE === $app_secret ) { 29 29 wp_die( __( 'The plugin is not configured.', HEWA_LANGUAGE_DOMAIN ) ); 30 30 } … … 102 102 function hewa_get_server_url() { 103 103 104 return hewa_get_option( HEWA_SETTINGS_SERVER_URL, false ); 104 return HELIXWARE_SERVER_URL; 105 105 106 } -
helixware/trunk/readme.txt
r1109485 r1263459 1 1 === Plugin Name === 2 Contributors: insideout10 3 Tags: video, streaming, SEO, audio, HLS, Flash4 Requires at least: 4. 05 Tested up to: 4. 1.16 Stable tag: 1. 0.02 Contributors: insideout10, ziodave 3 Tags: video, streaming, ondemand, SEO, audio, HLS, Flash, OTT, DASH, rtsp 4 Requires at least: 4.3 5 Tested up to: 4.3.1 6 Stable tag: 1.1.0 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 39 39 == Changelog == 40 40 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 41 51 = 1.0.0 = 52 42 53 * First release. -
helixware/trunk/shortcodes/helixware_shortcode_player.php
r1108802 r1263459 20 20 // TODO: default width and height ratio should be calculated from the video. 21 21 $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, 25 26 'aspectratio' => '5:3', 26 'listbar' => null,27 'listbar' => NULL, 27 28 'listbar_size' => 240, 28 29 'listbar_cat' => 'for-you', 29 'autostart' => true,30 'autostart' => TRUE, 30 31 'max' => 5, 31 32 'skin' => hewa_get_option( HEWA_SETTINGS_JWPLAYER_DEFAULT_SKIN, '' ), … … 53 54 // Build the player array which will then be translated to JavaScript for JWPlayer initialization. 54 55 $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; 58 59 $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" 61 62 : apply_filters( HEWA_FILTERS_PLAYER_PLAYLIST_URL, 62 63 admin_url( 'admin-ajax.php?action=hewa_rss&id=' . $asset_id . … … 64 65 '&i=' . $image_u . // set the image 65 66 '&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. 67 68 ) 68 69 ) ); … … 71 72 $player['ga'] = array( 72 73 // 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' ), 75 76 // 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' ) 77 78 ); 78 79 … … 97 98 98 99 // Build the *responsive* listbar. 99 if ( null!== $params['listbar'] && 'responsive' === $params['listbar'] ) {100 if ( NULL !== $params['listbar'] && 'responsive' === $params['listbar'] ) { 100 101 wp_enqueue_style( 'helixware-player-css', plugins_url( 'css/helixware.player.css', dirname( __FILE__ ) ) ); 101 102 … … 116 117 117 118 // Build a standard listbar. 118 if ( null!== $params['listbar'] && 'responsive' !== $params['listbar'] ) {119 if ( NULL !== $params['listbar'] && 'responsive' !== $params['listbar'] ) { 119 120 120 121 $player['listbar'] = array( … … 129 130 130 131 // 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 ) ); 132 134 $result .= <<<EOF 133 135 <script type="text/javascript"> 134 136 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); 140 139 141 140 EOF; … … 201 200 202 201 // Close the script and return the results. 203 return $result . '}); });</script>';202 return $result . '});</script>'; 204 203 205 204 }
Note: See TracChangeset
for help on using the changeset viewer.