-
Notifications
You must be signed in to change notification settings - Fork 2
/
MediaElementPlugin.txt
103 lines (81 loc) · 5.34 KB
/
MediaElementPlugin.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
%META:TOPICINFO{author="ProjectContributor" comment="" date="1574085126" format="1.1" version="1"}%
---+!! %TOPIC%
%FORMFIELD{"Description"}%
%TOC%
This plugin adds media support to Foswiki using [[https://www.mediaelementjs.com/][MediaElement.js]]. !MediaElement.js is an easy
cross-browser HTML5 audio and video player in pure HTML and CSS while providing a Flash or Silverlight fallback
for older browsers.
!MediaElement.js is a fully skinnable player with features like support for the <track> element, fullscreen video, and even Ambilight.
It provides a consistent experience regardless of what codecs and plugins browsers support.
Note that %TOPIC% is _not_ implementing a streaming media server, nor is it converting audio and video files in appropriate
file formats understood by today's browsers.
It is recommended to secure your attachments using Foswiki:Extensions/XSendFileContrib and _not_ using Foswiki's native =viewfile= method.
This will relive Foswiki from the pure delivery of the media files and instead delegate the actual process of sending over files to
the HTTP server in use.
---++ Usage
To embed a video or audio file into Foswiki, just upload it and add
<verbatim class="tml">
%VIDEO{"myvideo.mp4"}%
</verbatim>
to the topic page. You should get something similar to this:
<img src="%ATTACHURLPATH%/Video.png" width="560" height="315" />
Similarly, add
<verbatim class="tml">
%AUDIO{"mysong.mp3"}%
</verbatim>
to render an audio player for your song as part of the page.
<img src="%ATTACHURLPATH%/Audio.png" width="400" height="29" />
---++ Syntax
---+++ VIDEO
| *Parameter* | *Description* | *Default* |
| "..." | video file to be displayed, or comma-separated list of videos in alternative file formats being presented to the user's browser | |
| topic | topic to look for the video file | current topic |
| mime | specify mime type of the video file | derived from video file |
| width | width of video player | 320 |
| height | height of video player | 240 |
| controls | boolean to switch on/off controls of the player | on |
| preload | boolean whether the player should pre-load the beginning of the video when the page is loaded | off |
| autoplay | boolean whether the video should immediately start playing when the page containing the %VIDEO macro is loaded | off |
| rotate | degrees to which the video should be rotated; this comes in handy when videos have been uploaded from a mobile camera | 0 |
| poster | url of still image to be displayed as long as the video didn't start playing yet | extracted from video using Foswiki:Extensions/ImagePlugin |
| frame | the frame of the video to be extracted as a poster | 0 |
| id | HTML id for the video element holding the player | random |
| skin | name of the skin used for the player: "default", "ted" or "wmp" | default |
| stretch | configure stretching of video geometry | responsive (unless a width and/or height are specified) |
---+++ AUDIO
| *Parameter* | *Description* | *Default* |
| "..." | audio file to be displayed | |
| topic | topic to look for the audio file | current topic |
| preload | boolean whether the player should pre-load the beginning of the audio file when the page is loaded | off |
| autoplay | boolean whether the audio should immediately start playing when the page containing the %AUDIO macro is loaded | off |
| skin | name of the skin used for the player: "default", "ted" or "wmp" | default |
---++ Installation Instructions
%$INSTALL_INSTRUCTIONS%
---++ Dependencies
%$DEPENDENCIES%
---++ Change History
%TABLE{columnwidths="7em" tablewidth="100%"}%
| 25 Jan 2024: | added missing css file |
| 15 Jan 2024: | update to mediaelement-7.0.2 |
| 23 Aug 2022: | update to mediaelement-5.0.5 |
| 27 Oct 2020: | update to mediaelement-4.2.16; \
don't hard-code defaults for width and height; \
new =stretch= parameter |
| 18 Nov 2019: | upgraded to latest version of mediaelement.js; removed support for flash and silverlight |
| 05 Mar 2018: | added missing png file |
| 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 |
%META:FILEATTACHMENT{name="Audio.png" attachment="MediaElementSnap3.png" attr="" comment="" date="1574085126" size="2461" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="Video.png" attachment="MediaElementSnap2.png" attr="" comment="" date="1574085126" 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-2024 Michael Daum"}%
%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)]]"}%
%META:FIELD{name="Release" title="Release" value="%$RELEASE%"}%
%META:FIELD{name="Repository" title="Repository" value="https://github.com/foswiki/%TOPIC%"}%
%META:FIELD{name="Support" title="Support" value="Foswiki:Support/%TOPIC%"}%
%META:FIELD{name="Version" title="Version" value="%$VERSION%"}%