Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V0.6b #4

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Joomla 1.5/language/en-GB.plg_content_pb_mediael.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# License GNU/GPL http://www.gnu.org/copyleft/gpl.html

# pb_mediael.xml
PLUGIN DESC=<h1>pb:MediaEl 0.5 [Plugin]</h1><strong>Based on Media Element.JS 2.6.5 (<a href="_QQ_"http://mediaelementjs.com"_QQ_" title="Homepage of Media Element.JS"_QQ_" target="_QQ_"_blank"_QQ_">http://mediaelementjs.com</a>)</strong><p><strong>Description:</strong><br />Content Plugin which provides a HTML5 Video Player for Joomla! 1.6.</p><p><strong>Syntax:</strong><br />Place the following code in an article: <pre wrap="_QQ_"wrap"_QQ_">{pb_mediael media=[video] width=[640] height=[480] autoplay=[true] preload=[true] loop=[true] video_mp4=[http://myvideo.mp4] video_m4v=[http://myvideo.m4v] video_mov=[http://myvideo.mov] video_webm=[http://myvideo.webm] video_ogg=[http://myvideo.ogg] flash=[http://myvideo.mp4] image=[http://myvideo.png] image_visibility=[true]}<br/>or<br/>{pb_mediael media=[audio] width=[250] height=[25] autoplay=[true] preload=[true] loop=[true] audio_m4a=[http://myaudio.m4a] audio_mp3=[http://myaudio.mp3] audio_mpeg=[http://myaudio.mpeg] flash=[http://myaudio.mp4] image=[http://myvideo.png] image_visibility=[true]}</pre></p><p>These are all parameters. Minimum required is media, width, height and a source file.</p><p>For video: MP4, M4V and MOV should be encoded as H264 - these can also be specified as the Flash fallback file. Silverlight will automatically use the same files.</p><p>For audio: any of the listed formats can be used for the Flash file.</p>
PLUGIN DESC=<h1>pb:MediaEl 0.6b [Plugin]</h1><strong>Based on Media Element.JS 2.6.5 (<a href="_QQ_"http://mediaelementjs.com"_QQ_" title="Homepage of Media Element.JS"_QQ_" target="_QQ_"_blank"_QQ_">http://mediaelementjs.com</a>)</strong><p><strong>Description:</strong><br />Content Plugin which provides a HTML5 Video Player for Joomla! 1.5.</p><p><strong>Syntax:</strong><br />Place the following code in an article: <pre wrap="_QQ_"wrap"_QQ_">{pb_mediael media=[video] width=[640] height=[480] autoplay=[true] preload=[true] loop=[true] video_mp4=[http://myvideo.mp4] video_m4v=[http://myvideo.m4v] video_mov=[http://myvideo.mov] video_webm=[http://myvideo.webm] video_ogg=[http://myvideo.ogg] flash=[http://myvideo.mp4] image=[http://myvideo.png] image_visibility=[true] downloadlinks=[true] linktext=[Download now: ]}<br/>or<br/>{pb_mediael media=[audio] width=[250] height=[25] autoplay=[true] preload=[true] loop=[true] audio_m4a=[http://myaudio.m4a] audio_mp3=[http://myaudio.mp3] audio_mpeg=[http://myaudio.mpeg] flash=[http://myaudio.mp4] image=[http://myvideo.png] image_visibility=[true] downloadlinks=[true] linktext=[Download now: ]}</pre></p><p>These are all parameters. Minimum required is media, width, height and a source file.</p><p>For video: MP4, M4V and MOV should be encoded as H264 - these can also be specified as the Flash fallback file. Silverlight will automatically use the same files.</p><p>For audio: any of the listed formats can be used for the Flash file.</p>

# Video
DEFAULT AUDIO PARAMETER=<strong>Audio Parameter</strong>
Expand Down Expand Up @@ -47,6 +47,8 @@ LABEL PRELOAD=Preload
LABEL LOOP=Loop
LABEL DEFAULT VOLUME=Default Volume
LABEL WMODE=WMode
LABEL DOWNLOADLINKS=Download text always visible?
LABEL LINKTEXT=Text for download links

DESC MEDIA=Media type - video or audio.
DESC WIDTH=Width.
Expand All @@ -57,3 +59,5 @@ DESC PRELOAD=Preload the video.
DESC LOOP=Loops the video. Actually it works only in HTML.
DESC DEFAULT VOLUME=Will be overridden by local volume if available.
DESC WMODE=Here you can choose the wmode for flash player (e.g. opaque, to place elements above flash).
DESC DOWNLOADLINKS=Should the download links always be visible? Or only when Javascript is disabled?
DESC LINKTEXT=Define text that should proceed format list for download list
26 changes: 17 additions & 9 deletions Joomla 1.5/pb_mediael.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function pluginPbMediaEl(&$row, &$params) {
}
}
if (!$foundJqueryScripts) {
$document->addScript('https://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js');
$document->addScript('//ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js');
}
$foundMediaelScripts = false;
for ($i = 0; $i<count($scripts); $i++) {
Expand All @@ -63,9 +63,14 @@ function pluginPbMediaEl(&$row, &$params) {
}
}

$downloadlinks = $pluginParams->get('downloadlinks','0');
if ($downloadlinks == "false" || $downloadlinks == "0") {
$showhidedownload = '$j(".PbMediaEl").hide();';
}
$document->addScriptDeclaration('
var $j = jQuery.noConflict();
$j(document).ready(function() {
'.$showhidedownload.'
$j("video,audio").mediaelementplayer({
startVolume: '.$pluginParams->get('defaultVolume', '0.85').',
enableAutosize: true,
Expand Down Expand Up @@ -116,6 +121,7 @@ function contentPbMediaEl_getParams($videoParams, $pluginParams) {
$videoParamsList['image'] = $pluginParams->get('image');
$videoParamsList['image_visibility'] = $pluginParams->get('image_visibility');
$videoParamsList['flash'] = $pluginParams->get('flash');
$videoParamsList['linktext'] = $pluginParams->get('linktext');

$items = explode(' ', $videoParams);

Expand Down Expand Up @@ -147,13 +153,14 @@ function contentPbMediaEl_createHTML($id, &$pluginParams, &$videoParamsList) {
$video_mov = $videoParamsList['video_mov'];
$video_webm = $videoParamsList['video_webm'];
$video_ogg = $videoParamsList['video_ogg'];
$link_text = $videoParamsList['linktext'];
$flash = $videoParamsList['flash'];
$image = $videoParamsList['image'];
$image_visibility = $videoParamsList['image_visibility'];
$wmode = $pluginParams->get('wmode', 'default');
$uri_flash = '';
$uri_image = '';

// Add URI for local flash video
if (stripos($flash, 'http://') === false) {
$uri_flash = JURI::base();
Expand Down Expand Up @@ -191,13 +198,13 @@ function contentPbMediaEl_createHTML($id, &$pluginParams, &$videoParamsList) {

// Poster image
if ($image_visibility == "true" || $image_visibility == "1") {
$poster_html = ' poster="'.$image;
$poster_html = ' poster="'.$image.'"';
} else {
$poster_html = '';
}

// HTML output
$html = '<'.$media.' width="'.$width.'" height="'.$height.'" controls="controls"'.$autoplay_html.$preload_html.$loop_html.$poster_html.'">';
$html = '<'.$media.' width="'.$width.'" height="'.$height.'" controls="controls"'.$autoplay_html.$preload_html.$loop_html.$poster_html.'>';

if ($audio_m4a != "") {
$html .= '<source src="'.$audio_m4a.'" type="audio/m4a" />';
Expand Down Expand Up @@ -241,7 +248,9 @@ function contentPbMediaEl_createHTML($id, &$pluginParams, &$videoParamsList) {
$html .= '</object>';
}

$html .='<span class="PbMediaEl"><strong>If you cannot see the media above - download here: </strong>';
$html .= '</'.$media.'>';

$html .='<p class="PbMediaEl">'.$linktext.' ';

if ($audio_m4a != "") {
$html .= '<a href="'.$audio_m4a.'">M4A</a> ';
Expand Down Expand Up @@ -269,11 +278,10 @@ function contentPbMediaEl_createHTML($id, &$pluginParams, &$videoParamsList) {
$html .= '<a href="'.$video_ogg.'">Ogg</a><br>';
}

$html .= '</span>';

$html .= '</'.$media.'>';
$html .= '</p>';


return $html;

}
}
?>
7 changes: 6 additions & 1 deletion Joomla 1.5/pb_mediael.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<license>GNU/GPL http://www.gnu.org/copyleft/gpl.html</license>
<authorEmail>[email protected]</authorEmail>
<authorUrl>www2.mrc-lmb.cam.ac.uk</authorUrl>
<version>0.5</version>
<version>0.6b</version>
<description>PLUGIN DESC</description>
<files>
<filename plugin="pb_mediael">pb_mediael.php</filename>
Expand Down Expand Up @@ -58,5 +58,10 @@
<option value="opaque">opaque</option>
<option value="transparent">transparent</option>
</param>
<param name="downloadlinks" type="radio" default="0" label="LABEL DOWNLOADLINKS" description="DESC DOWNLOADLINKS">
<option value="0">No</option>
<option value="1">Yes</option>
</param>
<param name="linktext" type="text" default="Download links:" label="LABEL LINKTEXT" description="DESC LINKTEXT" size="40" />
</params>
</install>
4 changes: 2 additions & 2 deletions Joomla 1.6/pb_mediael/pb_mediael.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,13 +195,13 @@ protected function contentPbMediaEl_createHTML($id, &$pluginParams, &$videoParam

// Poster image
if ($image_visibility == "true" || $image_visibility == "1") {
$poster_html = ' poster="'.$image;
$poster_html = ' poster="'.$image.'"';
} else {
$poster_html = '';
}

// HTML output
$html = '<'.$media.' width="'.$width.'" height="'.$height.'" controls="controls"'.$autoplay_html.$preload_html.$loop_html.$poster_html.'">';
$html = '<'.$media.' width="'.$width.'" height="'.$height.'" controls="controls"'.$autoplay_html.$preload_html.$loop_html.$poster_html.'>';

if ($audio_m4a != "") {
$html .= '<source src="'.$audio_m4a.'" type="audio/m4a" />';
Expand Down