Permalink
Browse files

Item14478: fixed initialization of media player

  • Loading branch information...
1 parent 4efc660 commit c3e06824281980cf538e7a21a20206bdee8d9d60 MichaelDaum committed Sep 13, 2017
@@ -82,6 +82,7 @@ to render an audio player for your song as part of the page.
---++ Change History
%TABLE{columnwidths="7em" tablewidth="100%"}%
+| 13 Sep 2017: | only initialized video and audio elements of type =.jqMediaElement= |
| 01 Dec 2016: | upgraded to mediaelement-2.23.4; use Foswiki::Func api to read files (oops) |
| 02 Sep 2016: | updated to latest release of mejs |
| 12 Dec 2014: | initial release |
@@ -90,7 +91,7 @@ to render an audio player for your song as part of the page.
%META:FILEATTACHMENT{name="Video.png" attachment="MediaElementSnap2.png" attr="" comment="" date="1418394213" size="189478" user="ProjectContributor" version="1"}%
%META:FORM{name="PackageForm"}%
%META:FIELD{name="Author" title="Author" value="Michael Daum"}%
-%META:FIELD{name="Copyright" title="Copyright" value="© 2010-2016, John Dyer http://j.hn, © 2014-2016 Michael Daum http://michaeldaumconsulting.com"}%
+%META:FIELD{name="Copyright" title="Copyright" value="© 2010-2016, John Dyer http://j.hn, © 2014-2017 Michael Daum http://michaeldaumconsulting.com"}%
%META:FIELD{name="Description" title="Description" value="%25$SHORTDESCRIPTION%25"}%
%META:FIELD{name="Home" title="Home" value="Foswiki:Extensions/%TOPIC%"}%
%META:FIELD{name="License" title="License" value="[[http://www.gnu.org/licenses/gpl.html][GPL (Gnu General Public License)]]"}%
@@ -1,6 +1,6 @@
# Plugin for Foswiki - The Free and Open Source Wiki, http://foswiki.org/
#
-# MediaElementPlugin is Copyright (C) 2014-2016 Michael Daum http://michaeldaumconsulting.com
+# MediaElementPlugin is Copyright (C) 2014-2017 Michael Daum http://michaeldaumconsulting.com
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -19,8 +19,8 @@ use strict;
use warnings;
use Foswiki::Plugins::JQueryPlugin ();
-our $VERSION = '2.01';
-our $RELEASE = '01 Dec 2016';
+our $VERSION = '2.10';
+our $RELEASE = '13 Sep 2017';
our $SHORTDESCRIPTION = "Cross-browser embedding of videos and audios";
our $NO_PREFS_IN_TOPIC = 1;
@@ -88,7 +88,7 @@ sub handleVIDEO {
url => $url,
mimeType => $mimeType || $this->getMimeType($file),
poster => '%IMAGE{"'.$url.'" frame="'.$frame.'" output="png" width="'.$width.'" '.($height ne 'auto'?'height="'.$height.'"':'').' format="$src" crop="on" '.($rotate?'rotate="'.$rotate.'"':'').' warn="off"}%',
- placeholder => '%IMAGE{"'.$url.'" frame="'.$frame.'" output="png" width="'.$width.'" '.($height ne 'auto'?'height="'.$height.'"':'').' title="'.$placeholder.'" type="plain" crop="on"}%',
+ placeholder => '%IMAGE{"'.$url.'" frame="'.$frame.'" output="png" width="'.$width.'" '.($height ne 'auto'?'height="'.$height.'"':'').' title="'.$placeholder.'" type="plain" crop="on" warn="off"}%',
}
}
@@ -106,7 +106,7 @@ sub handleVIDEO {
my $skin = $params->{skin} || '';
my $class = '';
- $class="class='mejs-$skin" if $skin && $skin ne 'default';
+ $class="mejs-$skin" if $skin && $skin ne 'default';
my $poster = $params->{poster} || '';
if (!$autoplay && $poster !~ /^(none|off)$/) {
@@ -122,7 +122,7 @@ sub handleVIDEO {
my $id = $params->{id} || "mej-". (int( rand(10000) ) + 1);
my $result = <<HERE;
-<video id="$id" $class $style width="$width" height="$height" $poster $controls $autoplay $preload>
+<video id="$id" class="jqMediaElement $class" $style width="$width" height="$height" $poster $controls $autoplay $preload>
$videos
<object width="$width" height="$height" type="application/x-shockwave-flash" data="%PUBURLPATH%/%SYSTEMWEB%/MediaElementPlugin/flashmediaelement.swf">
<param name="movie" value="%PUBURLPATH%/%SYSTEMWEB%/MediaElementPlugin/flashmediaelement.swf" />
@@ -148,15 +148,15 @@ sub handleAUDIO {
my $skin = $params->{skin} || '';
my $class = '';
- $class="class='mejs-$skin" if $skin;
+ $class="mejs-$skin" if $skin;
my $url = '';
unless ($url =~ /^https?:/i) {
$url = Foswiki::Func::getPubUrlPath() . '/' . $web . '/' . $topic . '/' . $audio;
}
my $result = <<HERE;
-<audio $class src="$url" $autoplay $preload></audio>
+<audio class="jqMediaElement $class" src="$url" $autoplay $preload></audio>
HERE
return $result;
@@ -187,7 +187,7 @@ sub getMimeType {
__END__
Foswiki - The Free and Open Source Wiki, http://foswiki.org/
-Copyright (C) 2013-2016 Michael Daum http://michaeldaumconsulting.com
+Copyright (C) 2013-2017 Michael Daum http://michaeldaumconsulting.com
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@@ -1,3 +1,4 @@
+!noci
data/System/MediaElementPlugin.txt 0644
lib/Foswiki/Plugins/MediaElementPlugin/Core.pm 0644
lib/Foswiki/Plugins/MediaElementPlugin/DEPENDENCIES 0644
@@ -6222,8 +6222,8 @@ if (typeof jQuery != 'undefined') {
// handle clicks to the source radio buttons
.delegate('input[type=radio]', 'click', function() {
// set aria states
- $(this).attr('aria-selected', true).attr('checked', 'checked');
- $(this).closest('.mejs-sourcechooser-selector').find('input[type=radio]').not(this).attr('aria-selected', 'false').removeAttr('checked');
+ $(this).attr('aria-selected', true).prop('checked', true);
+ $(this).closest('.mejs-sourcechooser-selector').find('input[type=radio]').not(this).attr('aria-selected', 'false').prop('checked', false);
var src = this.value;
@@ -6652,4 +6652,4 @@ Marker position and a reference to the MediaElement Player object is passed to t
}
});
-})(mejs.$);
+})(mejs.$);
@@ -2,7 +2,7 @@
jQuery(function($) {
var defaults = {};
- $("audio,video").livequery(function() {
+ $("audio.jqMediaElement, video.jqMediaElement").livequery(function() {
var $this = $(this),
opts = $.extend({}, defaults, $this.data());
@@ -3780,8 +3780,8 @@ if (typeof jQuery != 'undefined') {
// handle clicks to the source radio buttons
.delegate('input[type=radio]', 'click', function() {
// set aria states
- $(this).attr('aria-selected', true).attr('checked', 'checked');
- $(this).closest('.mejs-sourcechooser-selector').find('input[type=radio]').not(this).attr('aria-selected', 'false').removeAttr('checked');
+ $(this).attr('aria-selected', true).prop('checked', true);
+ $(this).closest('.mejs-sourcechooser-selector').find('input[type=radio]').not(this).attr('aria-selected', 'false').prop('checked', false);
var src = this.value;
@@ -4210,4 +4210,4 @@ Marker position and a reference to the MediaElement Player object is passed to t
}
});
-})(mejs.$);
+})(mejs.$);
@@ -6222,8 +6222,8 @@ if (typeof jQuery != 'undefined') {
// handle clicks to the source radio buttons
.delegate('input[type=radio]', 'click', function() {
// set aria states
- $(this).attr('aria-selected', true).attr('checked', 'checked');
- $(this).closest('.mejs-sourcechooser-selector').find('input[type=radio]').not(this).attr('aria-selected', 'false').removeAttr('checked');
+ $(this).attr('aria-selected', true).prop('checked', true);
+ $(this).closest('.mejs-sourcechooser-selector').find('input[type=radio]').not(this).attr('aria-selected', 'false').prop('checked', false);
var src = this.value;
@@ -6652,11 +6652,12 @@ Marker position and a reference to the MediaElement Player object is passed to t
}
});
-})(mejs.$);"use strict";
+})(mejs.$);
+"use strict";
jQuery(function($) {
var defaults = {};
- $("audio,video").livequery(function() {
+ $("audio.jqMediaElement, video.jqMediaElement").livequery(function() {
var $this = $(this),
opts = $.extend({}, defaults, $this.data());

0 comments on commit c3e0682

Please sign in to comment.