Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasGraph committed Jul 13, 2017
2 parents 21ce674 + 9990a8f commit 9fd2187
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 24 deletions.
2 changes: 1 addition & 1 deletion docs/main/Basics.textile
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ h2. Uninstall
h3. From the admin interface

# Check the box on the left of the plugin row under the "Admin > Plugins":?event=plugin.
# open the select list at the bottom of the plugins tables and choose _Delete_.
# open the select list at the bottom of the plugins table and choose _Delete_.
# confirm the plugin deletion.

h3. Via Composer
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name" : "oui_player",
"description" : "Embed customised players",
"version" : "1.3.0",
"version" : "1.3.1",
"type" : 1,
"author" : "Nicolas Morand",
"author_uri" : "http://github.com/NicolasGraph",
Expand Down
11 changes: 8 additions & 3 deletions src/player/providers/Audio.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,14 @@ class Audio extends Video
*/
public function getPlayer()
{
$item = preg_match('/([.][a-z]+)/', $this->play) ? $this->getInfos() : $this->play;
$id = isset($item['id']) ? $item['id'] : $this->play;
$type = isset($item['type']) ? $item['type'] : 'id';
if (preg_match('/([.][a-z]+\/)/', $this->play)) {
$item = $this->getInfos();
$id = $item['id'];
$type = $item['type'];
} else {
$id = $this->play;
$type = 'id';
}

if ($item) {
if ($type === 'url') {
Expand Down
3 changes: 1 addition & 2 deletions src/player/providers/Bandcamp.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,7 @@ public function getInfos()
*/
public function getPlayer()
{
$item = preg_match('/([.][a-z]+\/)/', $this->play) ? $this->getInfos() : $this->play;
$id = isset($item['id']) ? $item['id'] : $this->play;
$id = preg_match('/([.][a-z]+\/)/', $this->play) ? $this->getInfos()['id'] : $this->play;

if ($id) {
$src = $this->src . $id;
Expand Down
7 changes: 3 additions & 4 deletions src/player/providers/Provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,8 @@ public function getSize()
isset($unit[0]) ? $dims['height'] .= $unit[0] : '';
} elseif ($dims['height']) {
$dims['width'] = $dims['height'] * $aspect;
preg_match("/(\D+)/", $dims['width'], $unit);
isset($unit[0]) ? $dims['height'] .= $unit[0] : '';
preg_match("/(\D+)/", $dims['height'], $unit);
isset($unit[0]) ? $dims['width'] .= $unit[0] : '';
}
}

Expand All @@ -223,8 +223,7 @@ public function getSize()
*/
public function getPlayer()
{
$item = preg_match('/([.][a-z]+\/)/', $this->play) ? $this->getInfos() : $this->play;
$id = isset($item['id']) ? $item['id'] : $this->play;
$id = preg_match('/([.][a-z]+\/)/', $this->play) ? $this->getInfos()['id'] : $this->play;

if ($id) {
$src = $this->src . $id;
Expand Down
11 changes: 8 additions & 3 deletions src/player/providers/Video.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,14 @@ public function getParams()
*/
public function getPlayer()
{
$item = preg_match('/([.][a-z]+)/', $this->play) ? $this->getInfos() : $this->play;
$id = isset($item['id']) ? $item['id'] : $this->play;
$type = isset($item['type']) ? $item['type'] : 'id';
if (preg_match('/([.][a-z]+\/)/', $this->play)) {
$item = $this->getInfos();
$id = $item['id'];
$type = $item['type'];
} else {
$id = $this->play;
$type = 'id';
}

if ($item) {
if ($type === 'url') {
Expand Down
20 changes: 10 additions & 10 deletions src/tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ function oui_player($atts, $thing)
{
global $thisarticle, $oui_player_item;

$class = 'Oui\Player\Main';
$obj = $class::getInstance();
$player = 'Oui\Player\Main';
$obj = $player::getInstance();

// Set tag attributes
$get_atts = $obj->getAtts(__FUNCTION__);
Expand All @@ -45,9 +45,9 @@ function oui_player($atts, $thing)
}

if ($provider) {
$class = 'Oui\Player\\' . $provider;
if (class_exists($class)) {
$obj = $class::getInstance();
$player = 'Oui\Player\\' . $provider;
if (class_exists($player)) {
$obj = $player::getInstance();
} else {
trigger_error('Unknown or unset provider: "' . $provider . '".');
return;
Expand All @@ -68,8 +68,8 @@ function oui_if_player($atts, $thing)
{
global $thisarticle, $oui_player_item;

$class = 'Oui\Player\Main';
$obj = $class::getInstance();
$player = 'Oui\Player\Main';
$obj = $player::getInstance();

// Set tag attributes
$get_atts = $obj->getAtts(__FUNCTION__);
Expand All @@ -78,9 +78,9 @@ function oui_if_player($atts, $thing)

// Check if the play attribute value is recognised.
if ($provider) {
$class = 'Oui\Player\\' . $provider;
if (class_exists($class)) {
$obj = $class::getInstance();
$player = 'Oui\Player\\' . $provider;
if (class_exists($player)) {
$obj = $player::getInstance();
} else {
trigger_error('Unknown or unset provider: "' . $provider . '".');
return;
Expand Down

0 comments on commit 9fd2187

Please sign in to comment.