public function Playlist::Playlist in MediaFront 6
Same name and namespace in other branches
- 6.2 players/osmplayer/player/playlist/Playlist.php \Playlist::Playlist()
- 7 players/osmplayer/player/playlist/Playlist.php \Playlist::Playlist()
Constructor
Parameters
- The playlist to generate and cache.:
- The XML schema to use when generating and caching the playlist.:
File
- players/
osmplayer/ player/ playlist/ Playlist.php, line 95
Class
- Playlist
- Playlist Class
Code
public function Playlist($_playlist = 'default', $_schema = SCHEMA_XSPF) {
$this->playlist = $_playlist;
$this->schema = $_schema;
// Set the base path and url of this class.
$base_root = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? 'https' : 'http';
$base_url = $base_root .= '://' . $_SERVER['HTTP_HOST'];
if ($dir = trim(dirname($_SERVER['SCRIPT_NAME']), '\\,/')) {
$base_url .= "/{$dir}";
}
$this->base_path = isset($params['base_path']) ? $params['base_path'] : trim(str_replace(realpath('.'), '', dirname(__FILE__)), '/');
$this->base_path = trim(str_replace('\\', '/', $this->base_path), '/');
$this->base_url = isset($params['base_url']) ? $params['base_url'] : $base_url . '/' . $this->base_path;
}