Skip to content
This repository has been archived by the owner on Jul 14, 2019. It is now read-only.

Commit

Permalink
HD detecting was implemented. Quality order list was changed
Browse files Browse the repository at this point in the history
  • Loading branch information
mklemarczyk committed Jul 28, 2018
1 parent a63115f commit 278e7ab
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/widgets/FluidPlayer.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,14 @@ public function init()
public function run()
{
$htmlView = HtmlVideo::beginVideo($this->id, $this->videoOptions);
$sources = [];
foreach ($this->sources as $key => $value) {
if ($value instanceof VideoSource && $value->validate()) {
$htmlView .= self::prepareSourceTag($value);
$sources[$value->qualityOrder . '_' . $key] = self::prepareSourceTag($value);
}
}
krsort($sources, SORT_NATURAL);
$htmlView .= implode($sources);
$htmlView .= HtmlVideo::endVideo();
return $htmlView;
}
Expand All @@ -72,6 +75,10 @@ protected function prepareSourceTag($source)
$options['type'] = $source->type;
$options['quality'] = $source->quality;

if ($source->isHdReady) {
$options['data-fluid-hd'] = 'true';
}

return HtmlVideo::source($source->source, $options);
}

Expand Down

0 comments on commit 278e7ab

Please sign in to comment.