Skip to content

Commit

Permalink
Bug fixes #12
Browse files Browse the repository at this point in the history
  • Loading branch information
aminyazdanpanah committed May 7, 2020
1 parent 23c25a5 commit 8194566
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ environment:
COMPOSER_NO_INTERACTION: 1
ANSICON: 121x90 (121x90) # Console colors

shaka_packager_download: https://github.com/google/shaka-packager/releases/download/v2.3.0/packager-win.exe
shaka_packager_download: https://github.com/google/shaka-packager/releases/download/v2.4.2/packager-win.exe

init:
- ps: $env:PATH = 'c:\tools\php;c:\ProgramData\ComposerSetup\bin;' + $env:PATH
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ php:
before_install:
- sudo add-apt-repository ppa:mc3man/trusty-media -y
- sudo apt-get update -q
- sudo wget https://github.com/google/shaka-packager/releases/download/v2.3.0/packager-linux
- sudo wget https://github.com/google/shaka-packager/releases/download/v2.4.2/packager-linux
- sudo chmod +x packager-linux
- sudo mv packager-linux /bin/packager
- composer self-update
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ You can add options to your DASH object using a callback method:
$export = $shaka->streams($stream1, $stream2, ...)
->mediaPackaging()
->DASH('output.mpd', function ($options) {
return $options->generateStaticMpd();
return $options->generateStaticLiveMpd();
//->other options;
})
->export();
Expand All @@ -163,7 +163,7 @@ $export = $shaka->streams($stream1, $stream2, ...)
#### DASH Options
| Option | Default | Description |
|:------------------------------------------------:|:-----------------------------:|:---------------------------------------------------------------------------------------------------------------------:|
| generateStaticMpd() | FALSE | If enabled, generates static mpd. If segment_template is specified in stream descriptors, shaka-packager generates dynamic mpd by default; if this flag is enabled, shaka-packager generates static mpd instead. Note that if segment_template is not specified, shaka-packager always generates static mpd regardless of the value of this flag. |
| generateStaticLiveMpd() | FALSE | If enabled, generates static mpd. If segment_template is specified in stream descriptors, shaka-packager generates dynamic mpd by default; if this flag is enabled, shaka-packager generates static mpd instead. Note that if segment_template is not specified, shaka-packager always generates static mpd regardless of the value of this flag. |
| baseUrls() | NULL | Comma separated BaseURLs for the MPD: <url>[,<url>]…. The values will be added as <BaseURL> element(s) immediately under the <MPD> element. |
| minBufferTime() | NULL | Specifies, in seconds, a common duration used in the definition of the MPD Representation data rate. |
| minimumUpdatePeriod() | NULL | Indicates to the player how often to refresh the media presentation description in seconds. This value is used for dynamic MPD only. |
Expand Down
2 changes: 1 addition & 1 deletion examples/adInsertion/dash_static-live.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
->streams($stream1, $stream2, $stream3, $stream4, $stream5, $stream6)
->mediaPackaging()
->DASH($output_path . 'h264.mpd', function ($options) {
return $options->generateStaticMpd()
return $options->generateStaticLiveMpd()
->adCues('600;1800;3000');
})
->export();
Expand Down
4 changes: 2 additions & 2 deletions examples/dash/static-live.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@
->initSegment($output_path . 'h264_1080p/init.mp4')
->segmentTemplate($output_path . 'h264_1080p/$Number$.m4s');

$export = \Shaka\Shaka::initialize()
$export = Shaka\Shaka::initialize()
->streams($stream1, $stream2, $stream3, $stream4, $stream5, $stream6)
->mediaPackaging()
->DASH($output_path . 'h264.mpd', function ($options) {
return $options->generateStaticMpd();
return $options->generateStaticLiveMpd();
})
->export();

Expand Down
14 changes: 7 additions & 7 deletions src/Options/DASH.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
class DASH extends General
{
/** @var bool */
private $generate_static_mpd;
private $generate_static_live_mpd;

/** @var string */
private $mpd_output;
Expand All @@ -42,22 +42,22 @@ class DASH extends General
/**
* @return array
*/
protected function __getGenerateStaticMpd()
protected function __getGenerateStaticLiveMpd()
{
if (!$this->generate_static_mpd) {
if (!$this->generate_static_live_mpd) {
return null;
}

return [MediaOptions::GENERATE_STATIC_MPD];
return [MediaOptions::GENERATE_STATIC_LIVE_MPD];
}

/**
* @param bool $generate_static_mpd
* @param bool $generate_static_live_mpd
* @return DASH
*/
public function generateStaticMpd(bool $generate_static_mpd = true): DASH
public function generateStaticLiveMpd(bool $generate_static_live_mpd = true): DASH
{
$this->generate_static_mpd = $generate_static_mpd;
$this->generate_static_live_mpd = $generate_static_live_mpd;
return $this;
}

Expand Down
2 changes: 1 addition & 1 deletion src/Options/MediaOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class MediaOptions


//DASH Options
const GENERATE_STATIC_MPD = '--generate_static_mpd';
const GENERATE_STATIC_LIVE_MPD = '--generate_static_live_mpd';

const MPD_OUTPUT = '--mpd_output';

Expand Down
2 changes: 1 addition & 1 deletion tests/DASHTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function testStaticLive()
->streams($audio, $text, $video)
->mediaPackaging()
->DASH($this->src_dir . '/dash_static_live/h264.mpd', function ($options) {
return $options->generateStaticMpd();
return $options->generateStaticLiveMpd();
})
->export();

Expand Down
2 changes: 1 addition & 1 deletion tests/MediaOptionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class MediaOptionsTest extends TestCase
public function testDASHOptions()
{
$output = (new DASH())->mpdOutput('whatever')
->generateStaticMpd()
->generateStaticLiveMpd()
->baseUrls('whatever')
->minBufferTime('whatever')
->minimumUpdatePeriod('whatever')
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/options/dash_options.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[
"--generate_static_mpd",
"--generate_static_live_mpd",
"--base_urls",
"whatever",
"--min_buffer_time",
Expand Down

0 comments on commit 8194566

Please sign in to comment.