From 3ab795ca966b15be9cf16519fc5f407818abc977 Mon Sep 17 00:00:00 2001 From: Phil Banks Date: Thu, 1 Mar 2012 21:58:32 +0000 Subject: [PATCH 1/5] 0.6b started. Protocol relative jQuery URL. Download links outside media element - hidden with jQuery + always show toggle in settings. --- Joomla 1.5/language/en-GB.plg_content_pb_mediael.ini | 4 +++- Joomla 1.5/pb_mediael.php | 12 +++++++----- Joomla 1.5/pb_mediael.xml | 6 +++++- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/Joomla 1.5/language/en-GB.plg_content_pb_mediael.ini b/Joomla 1.5/language/en-GB.plg_content_pb_mediael.ini index c04893b..ae0153b 100644 --- a/Joomla 1.5/language/en-GB.plg_content_pb_mediael.ini +++ b/Joomla 1.5/language/en-GB.plg_content_pb_mediael.ini @@ -2,7 +2,7 @@ # License GNU/GPL http://www.gnu.org/copyleft/gpl.html # pb_mediael.xml -PLUGIN DESC=

pb:MediaEl 0.5 [Plugin]

Based on Media Element.JS 2.6.5 (http://mediaelementjs.com)

Description:
Content Plugin which provides a HTML5 Video Player for Joomla! 1.6.

Syntax:
Place the following code in an article:

{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]}
or
{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]}

These are all parameters. Minimum required is media, width, height and a source file.

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.

For audio: any of the listed formats can be used for the Flash file.

+PLUGIN DESC=

pb:MediaEl 0.6b [Plugin]

Based on Media Element.JS 2.6.5 (http://mediaelementjs.com)

Description:
Content Plugin which provides a HTML5 Video Player for Joomla! 1.6.

Syntax:
Place the following code in an article:

{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]}
or
{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]}

These are all parameters. Minimum required is media, width, height and a source file.

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.

For audio: any of the listed formats can be used for the Flash file.

# Video DEFAULT AUDIO PARAMETER=Audio Parameter @@ -47,6 +47,7 @@ LABEL PRELOAD=Preload LABEL LOOP=Loop LABEL DEFAULT VOLUME=Default Volume LABEL WMODE=WMode +LABEL DOWNLOAD=Download text always visible? DESC MEDIA=Media type - video or audio. DESC WIDTH=Width. @@ -57,3 +58,4 @@ 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 DOWNLOAD=Should the download links always be visible? Or only when Javascript is disabled? diff --git a/Joomla 1.5/pb_mediael.php b/Joomla 1.5/pb_mediael.php index b76c032..6daaf58 100644 --- a/Joomla 1.5/pb_mediael.php +++ b/Joomla 1.5/pb_mediael.php @@ -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; $iaddScriptDeclaration(' var $j = jQuery.noConflict(); $j(document).ready(function() { + '$download = $pluginParams->get('download'); if ($download == "false" || $download == "0") {'$j(".PbMediaEl").hide();'}' $j("video,audio").mediaelementplayer({ startVolume: '.$pluginParams->get('defaultVolume', '0.85').', enableAutosize: true, @@ -149,6 +150,7 @@ function contentPbMediaEl_createHTML($id, &$pluginParams, &$videoParamsList) { $video_ogg = $videoParamsList['video_ogg']; $flash = $videoParamsList['flash']; $image = $videoParamsList['image']; + $download = $videoParamsList['download']; $image_visibility = $videoParamsList['image_visibility']; $wmode = $pluginParams->get('wmode', 'default'); $uri_flash = ''; @@ -241,7 +243,9 @@ function contentPbMediaEl_createHTML($id, &$pluginParams, &$videoParamsList) { $html .= ''; } - $html .='If you cannot see the media above - download here: '; + $html .= ''; + + $html .='

If you cannot see the media above - download here: '; if ($audio_m4a != "") { $html .= 'M4A '; @@ -269,9 +273,7 @@ function contentPbMediaEl_createHTML($id, &$pluginParams, &$videoParamsList) { $html .= 'Ogg
'; } - $html .= ''; - - $html .= ''; + $html .= '

'; return $html; diff --git a/Joomla 1.5/pb_mediael.xml b/Joomla 1.5/pb_mediael.xml index a77afeb..1c73349 100644 --- a/Joomla 1.5/pb_mediael.xml +++ b/Joomla 1.5/pb_mediael.xml @@ -7,7 +7,7 @@ GNU/GPL http://www.gnu.org/copyleft/gpl.html pb@mrc-lmb.cam.ac.uk www2.mrc-lmb.cam.ac.uk - 0.5 + 0.6b PLUGIN DESC pb_mediael.php @@ -58,5 +58,9 @@ + + + + \ No newline at end of file From a5640366a854649b007fa4b1408296955dbb0df8 Mon Sep 17 00:00:00 2001 From: Phil Banks Date: Thu, 1 Mar 2012 22:01:09 +0000 Subject: [PATCH 2/5] cleanup --- Joomla 1.5/pb_mediael.php | 1 - 1 file changed, 1 deletion(-) diff --git a/Joomla 1.5/pb_mediael.php b/Joomla 1.5/pb_mediael.php index 6daaf58..958b5e5 100644 --- a/Joomla 1.5/pb_mediael.php +++ b/Joomla 1.5/pb_mediael.php @@ -150,7 +150,6 @@ function contentPbMediaEl_createHTML($id, &$pluginParams, &$videoParamsList) { $video_ogg = $videoParamsList['video_ogg']; $flash = $videoParamsList['flash']; $image = $videoParamsList['image']; - $download = $videoParamsList['download']; $image_visibility = $videoParamsList['image_visibility']; $wmode = $pluginParams->get('wmode', 'default'); $uri_flash = ''; From 48d913ce76b1fd04f4b2dc9867a178ae43f7697c Mon Sep 17 00:00:00 2001 From: Phil Banks Date: Thu, 1 Mar 2012 22:51:32 +0000 Subject: [PATCH 3/5] Typo Quote error spotted by chris001 --- Joomla 1.5/pb_mediael.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Joomla 1.5/pb_mediael.php b/Joomla 1.5/pb_mediael.php index 958b5e5..e3e6e67 100644 --- a/Joomla 1.5/pb_mediael.php +++ b/Joomla 1.5/pb_mediael.php @@ -192,13 +192,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 .= ''; From 86964cb5a90ab16cce64415edb5315d96f3f95c2 Mon Sep 17 00:00:00 2001 From: Phil Banks Date: Thu, 1 Mar 2012 22:55:45 +0000 Subject: [PATCH 4/5] Quote type spotted by chris001 --- Joomla 1.6/pb_mediael/pb_mediael.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Joomla 1.6/pb_mediael/pb_mediael.php b/Joomla 1.6/pb_mediael/pb_mediael.php index 04db2c6..cab70a0 100644 --- a/Joomla 1.6/pb_mediael/pb_mediael.php +++ b/Joomla 1.6/pb_mediael/pb_mediael.php @@ -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 .= ''; From 8a24a06fb2f8bf3c28d2b13957711ac6efb408b8 Mon Sep 17 00:00:00 2001 From: emirpprime Date: Fri, 2 Mar 2012 14:20:56 +0000 Subject: [PATCH 5/5] 0.6 progress --- .../language/en-GB.plg_content_pb_mediael.ini | 8 +++++--- Joomla 1.5/pb_mediael.php | 15 +++++++++++---- Joomla 1.5/pb_mediael.xml | 3 ++- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/Joomla 1.5/language/en-GB.plg_content_pb_mediael.ini b/Joomla 1.5/language/en-GB.plg_content_pb_mediael.ini index ae0153b..e1fde08 100644 --- a/Joomla 1.5/language/en-GB.plg_content_pb_mediael.ini +++ b/Joomla 1.5/language/en-GB.plg_content_pb_mediael.ini @@ -2,7 +2,7 @@ # License GNU/GPL http://www.gnu.org/copyleft/gpl.html # pb_mediael.xml -PLUGIN DESC=

pb:MediaEl 0.6b [Plugin]

Based on Media Element.JS 2.6.5 (http://mediaelementjs.com)

Description:
Content Plugin which provides a HTML5 Video Player for Joomla! 1.6.

Syntax:
Place the following code in an article:

{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]}
or
{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]}

These are all parameters. Minimum required is media, width, height and a source file.

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.

For audio: any of the listed formats can be used for the Flash file.

+PLUGIN DESC=

pb:MediaEl 0.6b [Plugin]

Based on Media Element.JS 2.6.5 (http://mediaelementjs.com)

Description:
Content Plugin which provides a HTML5 Video Player for Joomla! 1.5.

Syntax:
Place the following code in an article:

{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: ]}
or
{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: ]}

These are all parameters. Minimum required is media, width, height and a source file.

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.

For audio: any of the listed formats can be used for the Flash file.

# Video DEFAULT AUDIO PARAMETER=Audio Parameter @@ -47,7 +47,8 @@ LABEL PRELOAD=Preload LABEL LOOP=Loop LABEL DEFAULT VOLUME=Default Volume LABEL WMODE=WMode -LABEL DOWNLOAD=Download text always visible? +LABEL DOWNLOADLINKS=Download text always visible? +LABEL LINKTEXT=Text for download links DESC MEDIA=Media type - video or audio. DESC WIDTH=Width. @@ -58,4 +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 DOWNLOAD=Should the download links always be visible? Or only when Javascript is disabled? +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 diff --git a/Joomla 1.5/pb_mediael.php b/Joomla 1.5/pb_mediael.php index e3e6e67..1be935b 100644 --- a/Joomla 1.5/pb_mediael.php +++ b/Joomla 1.5/pb_mediael.php @@ -63,10 +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() { - '$download = $pluginParams->get('download'); if ($download == "false" || $download == "0") {'$j(".PbMediaEl").hide();'}' + '.$showhidedownload.' $j("video,audio").mediaelementplayer({ startVolume: '.$pluginParams->get('defaultVolume', '0.85').', enableAutosize: true, @@ -117,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); @@ -148,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(); @@ -244,7 +250,7 @@ function contentPbMediaEl_createHTML($id, &$pluginParams, &$videoParamsList) { $html .= ''; - $html .='

If you cannot see the media above - download here: '; + $html .='

'.$linktext.' '; if ($audio_m4a != "") { $html .= 'M4A '; @@ -277,4 +283,5 @@ function contentPbMediaEl_createHTML($id, &$pluginParams, &$videoParamsList) { return $html; -} \ No newline at end of file +} +?> \ No newline at end of file diff --git a/Joomla 1.5/pb_mediael.xml b/Joomla 1.5/pb_mediael.xml index 1c73349..838efb8 100644 --- a/Joomla 1.5/pb_mediael.xml +++ b/Joomla 1.5/pb_mediael.xml @@ -58,9 +58,10 @@ - + + \ No newline at end of file