class MediaBrightcovePlaylistStreamWrapper in Brightcove Video Connect 7.4
Same name and namespace in other branches
- 7.7 brightcove_media/includes/MediaBrightcovePlaylistStreamWrapper.inc \MediaBrightcovePlaylistStreamWrapper
- 7.6 brightcove_media/includes/MediaBrightcovePlaylistStreamWrapper.inc \MediaBrightcovePlaylistStreamWrapper
@file Stream wrapper for Brightcove playlists.
Hierarchy
- class \MediaBrightcovePlaylistStreamWrapper extends \MediaReadOnlyStreamWrapper
Expanded class hierarchy of MediaBrightcovePlaylistStreamWrapper
1 string reference to 'MediaBrightcovePlaylistStreamWrapper'
- brightcove_media_stream_wrappers in brightcove_media/
brightcove_media.module - Implements hook_stream_wrappers().
File
- brightcove_media/
includes/ MediaBrightcovePlaylistStreamWrapper.inc, line 7 - Stream wrapper for Brightcove playlists.
View source
class MediaBrightcovePlaylistStreamWrapper extends MediaReadOnlyStreamWrapper {
/**
* Get MIME type.
*
* @static
* @param string $uri
* @param null $mapping
*
* @return string
*/
public static function getMimeType($uri, $mapping = NULL) {
return 'video/brightcove';
}
/**
* Get target.
*
* @return bool
*/
public function getTarget() {
return FALSE;
}
/**
* Interpolate an url.
*
* @return null|string
*/
public function interpolateUrl() {
if ($video_id = $this
->getVideoID()) {
// @todo find out how to detect this url in a nice way, it might break
// any time
$player = brightcove_default_player();
return url('http://c.brightcove.com/services/viewer/federated_f9', array(
'query' => array(
'playerID' => $player->player_id,
'playerKey' => $player->player_key,
'isVid' => 'true',
'isUI' => 'true',
'@videoPlayer' => $video_id,
),
));
}
return NULL;
}
/**
* Get a video id.
*
* @return null
*/
public function getVideoID() {
if ($url = parse_url($this->uri)) {
if ($url['scheme'] == 'brightcove-playlist' && is_numeric($url['host'])) {
return $url['host'];
}
}
return NULL;
}
/**
* Set uri.
*
* @param $uri
*/
public function setUri($uri) {
$this->uri = $uri;
}
/**
* Get the thumbnail path.
*
* @return null
*/
function getOriginalThumbnailPath() {
if ($video_id = $this
->getVideoID()) {
if ($video = brightcove_video_load($video_id)) {
return isset($video['thumbnailURL']) ? $video['thumbnailURL'] : NULL;
}
}
return NULL;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
MediaBrightcovePlaylistStreamWrapper:: |
public static | function | Get MIME type. | |
MediaBrightcovePlaylistStreamWrapper:: |
function | Get the thumbnail path. | ||
MediaBrightcovePlaylistStreamWrapper:: |
public | function | Get target. | |
MediaBrightcovePlaylistStreamWrapper:: |
public | function | Get a video id. | |
MediaBrightcovePlaylistStreamWrapper:: |
public | function | Interpolate an url. | |
MediaBrightcovePlaylistStreamWrapper:: |
public | function | Set uri. |