1 |
ca0757b9
|
Assos Assos
|
<?php
|
2 |
|
|
|
3 |
|
|
/**
|
4 |
|
|
* @file
|
5 |
|
|
* Extends the MediaReadOnlyStreamWrapper class to handle videos from an imaginary example.com.
|
6 |
|
|
*/
|
7 |
|
|
|
8 |
|
|
/**
|
9 |
|
|
* Create an instance like this:
|
10 |
|
|
* $media_internet_test = new MediaInternetTestStreamWrapper('mediainternettest://video/[video-code]');
|
11 |
|
|
*/
|
12 |
|
|
class MediaInternetTestStreamWrapper extends MediaReadOnlyStreamWrapper {
|
13 |
|
|
protected $base_url = 'http://example.com';
|
14 |
|
|
|
15 |
|
|
static function getMimeType($uri, $mapping = NULL) {
|
16 |
|
|
return 'video/mediainternettest';
|
17 |
|
|
}
|
18 |
|
|
|
19 |
|
|
function interpolateUrl() {
|
20 |
|
|
if ($parameters = $this->get_parameters()) {
|
21 |
|
|
return $this->base_url . '/' . $parameters['video'];
|
22 |
|
|
}
|
23 |
|
|
}
|
24 |
|
|
} |