Skip to content

Commit

Permalink
Merge pull request #609 from CastosHQ/release/2.5.3
Browse files Browse the repository at this point in the history
Release/2.5.3
  • Loading branch information
jonathanbossenger authored Feb 10, 2021
2 parents 77e714b + c9ca476 commit 95d7704
Show file tree
Hide file tree
Showing 32 changed files with 283 additions and 24 deletions.
181 changes: 180 additions & 1 deletion assets/css/castos-player.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,184 @@
/* Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500&family=Roboto:wght@400;500&display=swap');
/* devanagari */
@font-face {
font-family: 'Poppins';
font-style: normal;
font-weight: 400;
font-display: swap;
src: url(../fonts/poppins-400-devanagari.woff2) format('woff2');
unicode-range: U+0900-097F, U+1CD0-1CF6, U+1CF8-1CF9, U+200C-200D, U+20A8, U+20B9, U+25CC, U+A830-A839, U+A8E0-A8FB;
}
/* latin-ext */
@font-face {
font-family: 'Poppins';
font-style: normal;
font-weight: 400;
font-display: swap;
src: url(../fonts/poppins-400-latin-ext.woff2) format('woff2');
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'Poppins';
font-style: normal;
font-weight: 400;
font-display: swap;
src: url(../fonts/poppins-400-latin.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* devanagari */
@font-face {
font-family: 'Poppins';
font-style: normal;
font-weight: 500;
font-display: swap;
src: url(../fonts/poppins-500-devanagari.woff2) format('woff2');
unicode-range: U+0900-097F, U+1CD0-1CF6, U+1CF8-1CF9, U+200C-200D, U+20A8, U+20B9, U+25CC, U+A830-A839, U+A8E0-A8FB;
}
/* latin-ext */
@font-face {
font-family: 'Poppins';
font-style: normal;
font-weight: 500;
font-display: swap;
src: url(../fonts/poppins-500-latin-ext.woff2) format('woff2');
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'Poppins';
font-style: normal;
font-weight: 500;
font-display: swap;
src: url(../fonts/poppins-500-latin.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic-ext */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 400;
font-display: swap;
src: url(../fonts/roboto-400-cirillic-ext.woff2) format('woff2');
unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 400;
font-display: swap;
src: url(../fonts/roboto-400-cirillic.woff2) format('woff2');
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* greek-ext */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 400;
font-display: swap;
src: url(../fonts/roboto-400-greek-ext.woff2) format('woff2');
unicode-range: U+1F00-1FFF;
}
/* greek */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 400;
font-display: swap;
src: url(../fonts/roboto-400-greek.woff2) format('woff2');
unicode-range: U+0370-03FF;
}
/* vietnamese */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 400;
font-display: swap;
src: url(../fonts/roboto-400-vietnamese.woff2) format('woff2');
unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 400;
font-display: swap;
src: url(../fonts/roboto-400-latin-ext.woff2) format('woff2');
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 400;
font-display: swap;
src: url(../fonts/roboto-400-latin.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic-ext */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 500;
font-display: swap;
src: url(../fonts/roboto-500-cyrillic-ext.woff2) format('woff2');
unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 500;
font-display: swap;
src: url(../fonts/roboto-500-cyrillic.woff2) format('woff2');
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* greek-ext */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 500;
font-display: swap;
src: url(../fonts/roboto-500-greek-ext.woff2) format('woff2');
unicode-range: U+1F00-1FFF;
}
/* greek */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 500;
font-display: swap;
src: url(../fonts/roboto-500-greek.woff2) format('woff2');
unicode-range: U+0370-03FF;
}
/* vietnamese */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 500;
font-display: swap;
src: url(../fonts/roboto-500-vietnamese.woff2) format('woff2');
unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 500;
font-display: swap;
src: url(../fonts/roboto-500-latin-ext.woff2) format('woff2');
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 500;
font-display: swap;
src: url(../fonts/roboto-500-latin.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Defaults */
.castos-player {
Expand Down
Binary file added assets/fonts/poppins-400-devanagari.woff2
Binary file not shown.
Binary file added assets/fonts/poppins-400-latin-ext.woff2
Binary file not shown.
Binary file added assets/fonts/poppins-400-latin.woff2
Binary file not shown.
Binary file added assets/fonts/poppins-500-devanagari.woff2
Binary file not shown.
Binary file added assets/fonts/poppins-500-latin-ext.woff2
Binary file not shown.
Binary file added assets/fonts/poppins-500-latin.woff2
Binary file not shown.
Binary file added assets/fonts/roboto-400-cirillic-ext.woff2
Binary file not shown.
Binary file added assets/fonts/roboto-400-cirillic.woff2
Binary file not shown.
Binary file added assets/fonts/roboto-400-greek-ext.woff2
Binary file not shown.
Binary file added assets/fonts/roboto-400-greek.woff2
Binary file not shown.
Binary file added assets/fonts/roboto-400-latin-ext.woff2
Binary file not shown.
Binary file added assets/fonts/roboto-400-latin.woff2
Binary file not shown.
Binary file added assets/fonts/roboto-400-vietnamese.woff2
Binary file not shown.
Binary file added assets/fonts/roboto-500-cyrillic-ext.woff2
Binary file not shown.
Binary file added assets/fonts/roboto-500-cyrillic.woff2
Binary file not shown.
Binary file added assets/fonts/roboto-500-greek-ext.woff2
Binary file not shown.
Binary file added assets/fonts/roboto-500-greek.woff2
Binary file not shown.
Binary file added assets/fonts/roboto-500-latin-ext.woff2
Binary file not shown.
Binary file added assets/fonts/roboto-500-latin.woff2
Binary file not shown.
Binary file added assets/fonts/roboto-500-vietnamese.woff2
Binary file not shown.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "seriously-simple-podcasting",
"version": "2.2.0",
"version": "2.5.3",
"main": "build/index.js",
"author": "CastosHQ",
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions php/classes/controllers/class-admin-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ public function register_post_type() {
'new_item' => sprintf( __( 'New %s', 'seriously-simple-podcasting' ), __( 'Episode', 'seriously-simple-podcasting' ) ),
'all_items' => sprintf( __( 'All %s', 'seriously-simple-podcasting' ), __( 'Episodes', 'seriously-simple-podcasting' ) ),
'view_item' => sprintf( __( 'View %s', 'seriously-simple-podcasting' ), __( 'Episode', 'seriously-simple-podcasting' ) ),
'search_items' => sprintf( __( 'Search %a', 'seriously-simple-podcasting' ), __( 'Episodes', 'seriously-simple-podcasting' ) ),
'search_items' => sprintf( __( 'Search %s', 'seriously-simple-podcasting' ), __( 'Episodes', 'seriously-simple-podcasting' ) ),
'not_found' => sprintf( __( 'No %s Found', 'seriously-simple-podcasting' ), __( 'Episodes', 'seriously-simple-podcasting' ) ),
'not_found_in_trash' => sprintf( __( 'No %s Found In Trash', 'seriously-simple-podcasting' ), __( 'Episodes', 'seriously-simple-podcasting' ) ),
'parent_item_colon' => '',
Expand Down Expand Up @@ -609,7 +609,7 @@ public function add_series_columns( $column_data, $column_name, $term_id ) {
$default_image = esc_url( $this->assets_url . 'images/no-image.png' );
$media_id = get_term_meta( $term_id, $series_settings, true );
$image_attributes = wp_get_attachment_image_src( $media_id );
$source = ( ! is_null( $image_attributes[0] ) ) ? $image_attributes[0] : $default_image;
$source = ( isset( $image_attributes[0] ) ) ? $image_attributes[0] : $default_image;
$column_data = <<<HTML
<img id="{$series->name}_image_preview" src="{$source}" width="auto" height="auto" style="max-width:50px;" />
HTML;
Expand Down
16 changes: 16 additions & 0 deletions php/classes/controllers/class-episode-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,22 @@ public function get_episode_download_link( $episode_id, $referrer = '' ) {
return apply_filters( 'ssp_episode_download_link', esc_url( $link ), $episode_id, $file );
}

/**
* Get player link for episode.
*
* @param int $episode_id
*
* @return string
*/
public function get_episode_player_link( $episode_id ) {
$file = $this->get_episode_download_link( $episode_id );

// Switch to podcast player URL
$file = str_replace( 'podcast-download', 'podcast-player', $file );

return $file;
}

/**
* Returns the no album art image
*
Expand Down
7 changes: 7 additions & 0 deletions php/classes/controllers/class-frontend-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,13 @@ public function load_media_player( $src_file, $episode_id, $player_size ) {
$type = 'audio';
}

// Switch to podcast player URL
$src_file = str_replace( 'podcast-download', 'podcast-player', $src_file );

// Set up parameters for media player
$params = array( 'src' => $src_file, 'preload' => 'none' );


/**
* If the media file is of type video
* @todo is this necessary in the case of the HTML5 player?
Expand Down
19 changes: 14 additions & 5 deletions php/classes/controllers/class-players-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,22 @@ public function get_latest_episode_id() {
*
* @param int $id
*
* @return string
* @return array
*/
public function html_player( $id ) {
$audio_file = get_post_meta( $id, 'audio_file', true );
if ( empty( $audio_file ) ) {
return apply_filters( 'ssp_html_player_data', array() );
}

/**
* Get the episode (post) object
* If the id passed is empty or 0, get_post will return the current post
*/
$episode = get_post( $id );
$episode_duration = get_post_meta( $id, 'duration', true );
$episode_url = get_post_permalink( $id );
$audio_file = get_post_meta( $id, 'audio_file', true );
$audio_file = $this->episode_controller->get_episode_player_link( $id );
$album_art = $this->episode_controller->get_album_art( $id );
$podcast_title = get_option( 'ss_podcasting_data_title' );
$feed_url = $this->episode_repository->get_feed_url( $id );
Expand Down Expand Up @@ -109,16 +114,20 @@ public function html_player( $id ) {
*
* @param $episode_id
*
* @return mixed|void
* @return string
*/
public function render_html_player( $episode_id ) {
$template_data = $this->html_player( $episode_id );
if ( ! array_key_exists( 'audio_file', $template_data ) ) {
return '';
}

if ( wp_script_is( 'ssp-castos-player', 'registered' ) && ! wp_script_is( 'ssp-castos-player', 'enqueued' ) ) {
wp_enqueue_script( 'ssp-castos-player' );
}
if ( wp_style_is( 'ssp-castos-player', 'registered' ) && ! wp_style_is( 'ssp-castos-player', 'enqueued' ) ) {
wp_enqueue_style( 'ssp-castos-player' );
}
$template_data = $this->html_player( $episode_id );

return $this->renderer->render( $template_data, 'players/castos-player' );
}
Expand Down Expand Up @@ -155,7 +164,7 @@ public function media_player( $id ) {
* If the id passed is empty or 0, get_post will return the current post
*/
$episode = get_post( $id );
$src_file = get_post_meta( $episode->ID, 'audio_file', true );
$src_file = $this->episode_controller->get_episode_player_link( $id );
$params = array(
'src' => $src_file,
'preload' => 'none',
Expand Down
12 changes: 6 additions & 6 deletions php/classes/handlers/class-options-handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Options_Handler {
'downcast' => 'Downcast',
'google_play' => 'Google Play',
'google_podcasts' => 'Google Podcasts',
'himalaya.com' => 'Himalaya.com',
'himalaya_com' => 'Himalaya.com',
'laughable' => 'Laughable',
'libsyn' => 'Libsyn',
'listen_notes' => 'Listen Notes',
Expand All @@ -34,14 +34,14 @@ class Options_Handler {
'owltail' => 'OwlTail',
'pandora' => 'Pandora',
'patreon' => 'Patreon',
'player.fm' => 'Player.fm',
'player_fm' => 'Player.fm',
'plex' => 'Plex',
'pocketcasts' => 'PocketCasts',
'podbay' => 'Podbay',
'podbean' => 'Podbean',
'podcast_addict' => 'Podcast Addict',
'podcast_republic' => 'Podcast Republic',
'podcast.de' => 'Podcast.de',
'podcast_de' => 'Podcast.de',
'podchaser' => 'Podchaser',
'podcoin' => 'Podcoin',
'podfan' => 'Podfan',
Expand All @@ -51,7 +51,7 @@ class Options_Handler {
'rss' => 'RSS',
'rssradio' => 'RSSRadio',
'radio_public' => 'Radio Public',
'radio.com' => 'Radio.com',
'radio_com' => 'Radio.com',
'redcircle' => 'RedCircle',
'soundcloud' => 'SoundCloud',
'spotify' => 'Spotify',
Expand All @@ -60,11 +60,11 @@ class Options_Handler {
'the_podcast_app' => 'The Podcast App',
'tunein' => 'TuneIn',
'vkontakte' => 'VKontakte',
'we.fo' => 'We.fo',
'we_fo' => 'We.fo',
'yandex' => 'Yandex',
'youtube' => 'YouTube',
'custom' => 'custom',
'fyyd.de' => 'fyyd.de',
'fyyd_de' => 'fyyd.de',
'iheartradio' => 'iHeartRadio',
'itunes' => 'iTunes',
'ivoox' => 'iVoox',
Expand Down
Loading

0 comments on commit 95d7704

Please sign in to comment.