Skip to content

Commit

Permalink
removing vid_player function
Browse files Browse the repository at this point in the history
  • Loading branch information
Athlon1600 committed Dec 28, 2016
1 parent f9ba16e commit 69460d1
Showing 1 changed file with 0 additions and 42 deletions.
42 changes: 0 additions & 42 deletions src/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,48 +150,6 @@ function proxify_url($url, $base_url = ''){
return app_url().'?q='.url_encrypt($url);
}

function vid_player($url, $width, $height, $extension = false){

$path = parse_url($url, PHP_URL_PATH);

$html5 = false;

if($path){

$extension = $extension ? $extension : pathinfo($path, PATHINFO_EXTENSION);

if($extension == 'mp4' || $extension == 'webm' || $extension == 'ogg'){
$html5 = true;
}
}

// this better be an absolute url
$video_url = proxify_url($url);

if($html5){

$html = '<video width="100%" height="100%" controls autoplay>
<source src="'.$video_url.'" type="video/'.$extension.'">
Your browser does not support the video tag.
</video>';

} else {

// encode before embedding it into player's parameters
$video_url = rawurlencode($video_url);

$html = '<object id="flowplayer" width="'.$width.'" height="'.$height.'" data="//releases.flowplayer.org/swf/flowplayer-3.2.18.swf" type="application/x-shockwave-flash">
<param name="allowfullscreen" value="true" />
<param name="wmode" value="transparent" />
<param name="flashvars" value=\'config={"clip":"'.$video_url.'", "plugins": {"controls": {"autoHide" : false} }}\' />
</object>';
}

return $html;
}

function rel2abs($rel, $base)
{
if (strpos($rel, "//") === 0) {
Expand Down

0 comments on commit 69460d1

Please sign in to comment.