Skip to content

Commit

Permalink
Version 5.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
HitkoDev committed Aug 21, 2016
1 parent 8bbc8b7 commit 84837b6
Show file tree
Hide file tree
Showing 36 changed files with 1,577 additions and 1,571 deletions.
124 changes: 62 additions & 62 deletions build/libraries/videobox/adapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,69 +23,69 @@
defined( '_JEXEC' ) or die( 'Restricted Access' );

class VideoboxAdapter {

public $type = 'v';

function __construct(&$properties = array()){
$this->id = $properties['id'];
$this->title = isset($properties['title']) ? $properties['title'] : '';
$this->start = isset($properties['start']) ? $properties['start'] : 0;
$this->end = isset($properties['end']) ? $properties['end'] : 0;
$this->properties = &$properties;
}

function getThumb(){
$id = $this->id;
$ext = array('.png', '.jpg', '.jpeg', '.gif');
$file = $this->properties['assets_path'] . 'thumbs/' . $id;
foreach($ext as $ex){
if(is_file($file . $ex)){
$im = @getimagesize($file . $ex);
if($im !== false) return array($file . $ex, $im[2]);
}
}
return false;
}
public $type = 'v';

function getTitle($forced = false){
if($forced && $this->title==''){
return $this->id;
} else {
return $this->title;
}
}

function getPlayerLink($autoplay = false){
$src = $this->id;
if($autoplay) $src .= '?autoplay=1';
if($this->start != 0) $src .= '&start=' . $this->splitOffset($this->start);
if($this->end != 0) $src .= '&end=' . $this->splitOffset($this->end);
return $src;
}

function getSourceUrl(){
return '';
}

function getSourceFormats(){
return array();
}
function __construct(&$properties = array()){
$this->id = $properties['id'];
$this->title = isset($properties['title']) ? $properties['title'] : '';
$this->start = isset($properties['start']) ? $properties['start'] : 0;
$this->end = isset($properties['end']) ? $properties['end'] : 0;
$this->properties = &$properties;
}

function getThumb(){
$id = $this->id;
$ext = array('.png', '.jpg', '.jpeg', '.gif');
$file = $this->properties['assets_path'] . 'thumbs/' . $id;
foreach($ext as $ex){
if(is_file($file . $ex)){
$im = @getimagesize($file . $ex);
if($im !== false) return array($file . $ex, $im[2]);
}
}
return false;
}

function getTitle($forced = false){
if($forced && $this->title==''){
return $this->id;
} else {
return $this->title;
}
}

function getPlayerLink($autoplay = false){
$src = $this->id;
if($autoplay) $src .= '?autoplay=1';
if($this->start != 0) $src .= '&start=' . $this->splitOffset($this->start);
if($this->end != 0) $src .= '&end=' . $this->splitOffset($this->end);
return $src;
}

function getSourceUrl(){
return '';
}

function getSourceFormats(){
return array();
}

protected final function splitOffset($offset = 0){
if($offset != 0){
$off = '';
$s = $offset%60;
$off = $s . 's';
$offset = ($offset - $s)/60;
if($offset > 0){
$m = $offset%60;
$off = $m . 'm' . $off;
$h = ($offset - $m)/60;
if($h > 0) $off = $h . 'h' . $off;
}
return $off;
}
return '';
}

protected final function splitOffset($offset = 0){
if($offset != 0){
$off = '';
$s = $offset%60;
$off = $s . 's';
$offset = ($offset - $s)/60;
if($offset > 0){
$m = $offset%60;
$off = $m . 'm' . $off;
$h = ($offset - $m)/60;
if($h > 0) $off = $h . 'h' . $off;
}
return $off;
}
return '';
}

}
Loading

0 comments on commit 84837b6

Please sign in to comment.