Skip to content

Commit

Permalink
Refactor %%player_sources%%. See: #179
Browse files Browse the repository at this point in the history
  • Loading branch information
JasWSInc committed Aug 13, 2014
1 parent a7f442c commit b9fb86c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions s2member/includes/classes/sc-files-in.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,6 @@ public static function sc_get_stream($attr = array(), $content = '', $shortcode
$_total_player_sources, $_player_sources_counter, $_is_first_file_download_url, $_is_last_file_download_url,
$_file_download_url_label, $_file_download_url);

$player = preg_replace('/%%player_sources%%/', $player_sources, $player);

$player = preg_replace('/%%player_id%%/', $attr['player_id'], $player);
$player = preg_replace('/%%player_path%%/', $attr['player_path'], $player);
$player = preg_replace('/%%player_key%%/', $attr['player_key'], $player);
Expand All @@ -275,6 +273,8 @@ public static function sc_get_stream($attr = array(), $content = '', $shortcode
$player = preg_replace('/%%player_captions%%/', '['.((strpos($attr['player_captions'], ':') !== FALSE) ? $attr['player_captions'] : base64_decode($attr['player_captions'])).']', $player);
else $player = preg_replace('/%%player_captions%%/', '[]', $player);

$player = preg_replace('/%%player_sources%%/', $player_sources, $player); // Sources are constructed dynamically.

$player = preg_replace('/%%player_controls%%/', ((filter_var($attr['player_controls'], FILTER_VALIDATE_BOOLEAN)) ? 'true' : 'false'), $player);
$player = preg_replace('/%%player_width%%/', ((strpos($attr['player_width'], '%') !== FALSE) ? "'".$attr['player_width']."'" : (integer)$attr['player_width']), $player);
$player = preg_replace('/%%player_height%%/', (($attr['player_aspectratio']) ? "''" : ((strpos($attr['player_height'], '%') !== FALSE) ? "'".$attr['player_height']."'" : (integer)$attr['player_height'])), $player);
Expand Down

0 comments on commit b9fb86c

Please sign in to comment.