├── .editorconfig
├── .gitignore
├── GPL-LICENSE-2.txt
├── Gruntfile.js
├── MIT-LICENSE.txt
├── build
└── compiler.jar
├── demo
├── default-style
│ ├── css
│ │ └── player-styles.css
│ └── img
│ │ ├── dev
│ │ ├── play-overlay.png
│ │ └── player-sprites.png
│ │ ├── loader.gif
│ │ ├── play-overlay.png
│ │ └── player-sprites.png
├── embedded-player.html
├── font-style.html
├── font-style
│ ├── css
│ │ └── player-styles.css
│ ├── fonts
│ │ ├── fontawesome-ie7.css
│ │ ├── fontawesome-ie7.less
│ │ ├── fontawesome-webfont.afm
│ │ ├── fontawesome-webfont.eot
│ │ ├── fontawesome-webfont.ttf
│ │ ├── fontawesome-webfont.woff
│ │ ├── fontawesome.css
│ │ ├── fontawesome.less
│ │ ├── fontawesome.sass
│ │ ├── fontawesome.scss
│ │ └── icon-reference.html
│ └── img
│ │ └── loader.gif
├── index-plugin-dev.html
├── index.html
├── jme-jqm.html
├── jqm-style
│ ├── css
│ │ └── player-styles.css
│ └── img
│ │ ├── loader.gif
│ │ ├── play-overlay.png
│ │ └── player-sprites.png
├── js
│ ├── jme.base.js
│ ├── jme.base.min.js
│ ├── jme.full.js
│ ├── jme.full.min.js
│ └── plugins
│ │ ├── jme.embed.min.js
│ │ ├── jme.fullscreen.min.js
│ │ └── jme.track.min.js
└── media
│ └── sintel
│ ├── cc-by.png
│ ├── sintel-trailer.m4v
│ ├── sintel-trailer.png
│ ├── sintel-trailer.webm
│ ├── sintel-trailer_de.vtt
│ ├── sintel-trailer_en.vtt
│ ├── sintel-trailer_es.vtt
│ ├── sintel-trailer_fr.vtt
│ ├── sintel-trailer_it.vtt
│ └── sintel-trailer_nl.vtt
├── package.json
└── src
├── jme.embed.js
├── jme.fullscreen.js
├── jme.js
├── jme.playlist.js
└── jme.track.js
/.editorconfig:
--------------------------------------------------------------------------------
1 | # editorconfig.org
2 |
3 | # top-most EditorConfig file
4 | root = true
5 |
6 | [*]
7 | end_of_line = lf
8 | indent_style = tab
9 | charset = utf-8
10 | trim_trailing_whitespace = true
11 | insert_final_newline = true
12 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.swp
2 | *.un~
3 | *.tmp_*~
4 | node_modules/*
5 |
6 | .DS_Store
7 | .sass-cache
--------------------------------------------------------------------------------
/GPL-LICENSE-2.txt:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 2, June 1991
3 |
4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc.
5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6 | Everyone is permitted to copy and distribute verbatim copies
7 | of this license document, but changing it is not allowed.
8 |
9 | Preamble
10 |
11 | The licenses for most software are designed to take away your
12 | freedom to share and change it. By contrast, the GNU General Public
13 | License is intended to guarantee your freedom to share and change free
14 | software--to make sure the software is free for all its users. This
15 | General Public License applies to most of the Free Software
16 | Foundation's software and to any other program whose authors commit to
17 | using it. (Some other Free Software Foundation software is covered by
18 | the GNU Lesser General Public License instead.) You can apply it to
19 | your programs, too.
20 |
21 | When we speak of free software, we are referring to freedom, not
22 | price. Our General Public Licenses are designed to make sure that you
23 | have the freedom to distribute copies of free software (and charge for
24 | this service if you wish), that you receive source code or can get it
25 | if you want it, that you can change the software or use pieces of it
26 | in new free programs; and that you know you can do these things.
27 |
28 | To protect your rights, we need to make restrictions that forbid
29 | anyone to deny you these rights or to ask you to surrender the rights.
30 | These restrictions translate to certain responsibilities for you if you
31 | distribute copies of the software, or if you modify it.
32 |
33 | For example, if you distribute copies of such a program, whether
34 | gratis or for a fee, you must give the recipients all the rights that
35 | you have. You must make sure that they, too, receive or can get the
36 | source code. And you must show them these terms so they know their
37 | rights.
38 |
39 | We protect your rights with two steps: (1) copyright the software, and
40 | (2) offer you this license which gives you legal permission to copy,
41 | distribute and/or modify the software.
42 |
43 | Also, for each author's protection and ours, we want to make certain
44 | that everyone understands that there is no warranty for this free
45 | software. If the software is modified by someone else and passed on, we
46 | want its recipients to know that what they have is not the original, so
47 | that any problems introduced by others will not reflect on the original
48 | authors' reputations.
49 |
50 | Finally, any free program is threatened constantly by software
51 | patents. We wish to avoid the danger that redistributors of a free
52 | program will individually obtain patent licenses, in effect making the
53 | program proprietary. To prevent this, we have made it clear that any
54 | patent must be licensed for everyone's free use or not licensed at all.
55 |
56 | The precise terms and conditions for copying, distribution and
57 | modification follow.
58 |
59 | GNU GENERAL PUBLIC LICENSE
60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61 |
62 | 0. This License applies to any program or other work which contains
63 | a notice placed by the copyright holder saying it may be distributed
64 | under the terms of this General Public License. The "Program", below,
65 | refers to any such program or work, and a "work based on the Program"
66 | means either the Program or any derivative work under copyright law:
67 | that is to say, a work containing the Program or a portion of it,
68 | either verbatim or with modifications and/or translated into another
69 | language. (Hereinafter, translation is included without limitation in
70 | the term "modification".) Each licensee is addressed as "you".
71 |
72 | Activities other than copying, distribution and modification are not
73 | covered by this License; they are outside its scope. The act of
74 | running the Program is not restricted, and the output from the Program
75 | is covered only if its contents constitute a work based on the
76 | Program (independent of having been made by running the Program).
77 | Whether that is true depends on what the Program does.
78 |
79 | 1. You may copy and distribute verbatim copies of the Program's
80 | source code as you receive it, in any medium, provided that you
81 | conspicuously and appropriately publish on each copy an appropriate
82 | copyright notice and disclaimer of warranty; keep intact all the
83 | notices that refer to this License and to the absence of any warranty;
84 | and give any other recipients of the Program a copy of this License
85 | along with the Program.
86 |
87 | You may charge a fee for the physical act of transferring a copy, and
88 | you may at your option offer warranty protection in exchange for a fee.
89 |
90 | 2. You may modify your copy or copies of the Program or any portion
91 | of it, thus forming a work based on the Program, and copy and
92 | distribute such modifications or work under the terms of Section 1
93 | above, provided that you also meet all of these conditions:
94 |
95 | a) You must cause the modified files to carry prominent notices
96 | stating that you changed the files and the date of any change.
97 |
98 | b) You must cause any work that you distribute or publish, that in
99 | whole or in part contains or is derived from the Program or any
100 | part thereof, to be licensed as a whole at no charge to all third
101 | parties under the terms of this License.
102 |
103 | c) If the modified program normally reads commands interactively
104 | when run, you must cause it, when started running for such
105 | interactive use in the most ordinary way, to print or display an
106 | announcement including an appropriate copyright notice and a
107 | notice that there is no warranty (or else, saying that you provide
108 | a warranty) and that users may redistribute the program under
109 | these conditions, and telling the user how to view a copy of this
110 | License. (Exception: if the Program itself is interactive but
111 | does not normally print such an announcement, your work based on
112 | the Program is not required to print an announcement.)
113 |
114 | These requirements apply to the modified work as a whole. If
115 | identifiable sections of that work are not derived from the Program,
116 | and can be reasonably considered independent and separate works in
117 | themselves, then this License, and its terms, do not apply to those
118 | sections when you distribute them as separate works. But when you
119 | distribute the same sections as part of a whole which is a work based
120 | on the Program, the distribution of the whole must be on the terms of
121 | this License, whose permissions for other licensees extend to the
122 | entire whole, and thus to each and every part regardless of who wrote it.
123 |
124 | Thus, it is not the intent of this section to claim rights or contest
125 | your rights to work written entirely by you; rather, the intent is to
126 | exercise the right to control the distribution of derivative or
127 | collective works based on the Program.
128 |
129 | In addition, mere aggregation of another work not based on the Program
130 | with the Program (or with a work based on the Program) on a volume of
131 | a storage or distribution medium does not bring the other work under
132 | the scope of this License.
133 |
134 | 3. You may copy and distribute the Program (or a work based on it,
135 | under Section 2) in object code or executable form under the terms of
136 | Sections 1 and 2 above provided that you also do one of the following:
137 |
138 | a) Accompany it with the complete corresponding machine-readable
139 | source code, which must be distributed under the terms of Sections
140 | 1 and 2 above on a medium customarily used for software interchange; or,
141 |
142 | b) Accompany it with a written offer, valid for at least three
143 | years, to give any third party, for a charge no more than your
144 | cost of physically performing source distribution, a complete
145 | machine-readable copy of the corresponding source code, to be
146 | distributed under the terms of Sections 1 and 2 above on a medium
147 | customarily used for software interchange; or,
148 |
149 | c) Accompany it with the information you received as to the offer
150 | to distribute corresponding source code. (This alternative is
151 | allowed only for noncommercial distribution and only if you
152 | received the program in object code or executable form with such
153 | an offer, in accord with Subsection b above.)
154 |
155 | The source code for a work means the preferred form of the work for
156 | making modifications to it. For an executable work, complete source
157 | code means all the source code for all modules it contains, plus any
158 | associated interface definition files, plus the scripts used to
159 | control compilation and installation of the executable. However, as a
160 | special exception, the source code distributed need not include
161 | anything that is normally distributed (in either source or binary
162 | form) with the major components (compiler, kernel, and so on) of the
163 | operating system on which the executable runs, unless that component
164 | itself accompanies the executable.
165 |
166 | If distribution of executable or object code is made by offering
167 | access to copy from a designated place, then offering equivalent
168 | access to copy the source code from the same place counts as
169 | distribution of the source code, even though third parties are not
170 | compelled to copy the source along with the object code.
171 |
172 | 4. You may not copy, modify, sublicense, or distribute the Program
173 | except as expressly provided under this License. Any attempt
174 | otherwise to copy, modify, sublicense or distribute the Program is
175 | void, and will automatically terminate your rights under this License.
176 | However, parties who have received copies, or rights, from you under
177 | this License will not have their licenses terminated so long as such
178 | parties remain in full compliance.
179 |
180 | 5. You are not required to accept this License, since you have not
181 | signed it. However, nothing else grants you permission to modify or
182 | distribute the Program or its derivative works. These actions are
183 | prohibited by law if you do not accept this License. Therefore, by
184 | modifying or distributing the Program (or any work based on the
185 | Program), you indicate your acceptance of this License to do so, and
186 | all its terms and conditions for copying, distributing or modifying
187 | the Program or works based on it.
188 |
189 | 6. Each time you redistribute the Program (or any work based on the
190 | Program), the recipient automatically receives a license from the
191 | original licensor to copy, distribute or modify the Program subject to
192 | these terms and conditions. You may not impose any further
193 | restrictions on the recipients' exercise of the rights granted herein.
194 | You are not responsible for enforcing compliance by third parties to
195 | this License.
196 |
197 | 7. If, as a consequence of a court judgment or allegation of patent
198 | infringement or for any other reason (not limited to patent issues),
199 | conditions are imposed on you (whether by court order, agreement or
200 | otherwise) that contradict the conditions of this License, they do not
201 | excuse you from the conditions of this License. If you cannot
202 | distribute so as to satisfy simultaneously your obligations under this
203 | License and any other pertinent obligations, then as a consequence you
204 | may not distribute the Program at all. For example, if a patent
205 | license would not permit royalty-free redistribution of the Program by
206 | all those who receive copies directly or indirectly through you, then
207 | the only way you could satisfy both it and this License would be to
208 | refrain entirely from distribution of the Program.
209 |
210 | If any portion of this section is held invalid or unenforceable under
211 | any particular circumstance, the balance of the section is intended to
212 | apply and the section as a whole is intended to apply in other
213 | circumstances.
214 |
215 | It is not the purpose of this section to induce you to infringe any
216 | patents or other property right claims or to contest validity of any
217 | such claims; this section has the sole purpose of protecting the
218 | integrity of the free software distribution system, which is
219 | implemented by public license practices. Many people have made
220 | generous contributions to the wide range of software distributed
221 | through that system in reliance on consistent application of that
222 | system; it is up to the author/donor to decide if he or she is willing
223 | to distribute software through any other system and a licensee cannot
224 | impose that choice.
225 |
226 | This section is intended to make thoroughly clear what is believed to
227 | be a consequence of the rest of this License.
228 |
229 | 8. If the distribution and/or use of the Program is restricted in
230 | certain countries either by patents or by copyrighted interfaces, the
231 | original copyright holder who places the Program under this License
232 | may add an explicit geographical distribution limitation excluding
233 | those countries, so that distribution is permitted only in or among
234 | countries not thus excluded. In such case, this License incorporates
235 | the limitation as if written in the body of this License.
236 |
237 | 9. The Free Software Foundation may publish revised and/or new versions
238 | of the General Public License from time to time. Such new versions will
239 | be similar in spirit to the present version, but may differ in detail to
240 | address new problems or concerns.
241 |
242 | Each version is given a distinguishing version number. If the Program
243 | specifies a version number of this License which applies to it and "any
244 | later version", you have the option of following the terms and conditions
245 | either of that version or of any later version published by the Free
246 | Software Foundation. If the Program does not specify a version number of
247 | this License, you may choose any version ever published by the Free Software
248 | Foundation.
249 |
250 | 10. If you wish to incorporate parts of the Program into other free
251 | programs whose distribution conditions are different, write to the author
252 | to ask for permission. For software which is copyrighted by the Free
253 | Software Foundation, write to the Free Software Foundation; we sometimes
254 | make exceptions for this. Our decision will be guided by the two goals
255 | of preserving the free status of all derivatives of our free software and
256 | of promoting the sharing and reuse of software generally.
257 |
258 | NO WARRANTY
259 |
260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268 | REPAIR OR CORRECTION.
269 |
270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278 | POSSIBILITY OF SUCH DAMAGES.
--------------------------------------------------------------------------------
/Gruntfile.js:
--------------------------------------------------------------------------------
1 | module.exports = function(grunt) {
2 |
3 | grunt.initConfig({
4 | pkg: grunt.file.readJSON('package.json'),
5 | concat: {
6 | options: {
7 | separator: ';'
8 | },
9 | full: {
10 | src: ['src/jme.js', 'src/jme.fullscreen.js', 'src/jme.track.js'],
11 | dest: 'demo/js/jme.full.js'
12 | },
13 | base: {
14 | src: ['src/jme.js'],
15 | dest: 'demo/js/jme.base.js'
16 | }
17 | },
18 | uglify: {
19 | options: {
20 | banner: ''
21 | },
22 | full: {
23 | src: 'demo/js/jme.full.js',
24 | dest: 'demo/js/jme.full.min.js'
25 | },
26 | base: {
27 | src: 'demo/js/jme.base.js',
28 | dest: 'demo/js/jme.base.min.js'
29 | },
30 | fullscreen: {
31 | src: 'src/jme.fullscreen.js',
32 | dest: 'demo/js/plugins/jme.fullscreen.min.js'
33 | },
34 | track: {
35 | src: 'src/jme.track.js',
36 | dest: 'demo/js/plugins/jme.track.min.js'
37 | },
38 | track: {
39 | src: 'src/jme.embed.js',
40 | dest: 'demo/js/plugins/jme.embed.min.js'
41 | }
42 | },
43 | watch: {
44 | files: ['src/jme.js', 'src/jme.fullscreen.js', 'src/jme.track.js'],
45 | tasks: 'default'
46 | }
47 | });
48 |
49 | grunt.loadNpmTasks('grunt-contrib-concat');
50 | grunt.loadNpmTasks('grunt-contrib-uglify');
51 | grunt.loadNpmTasks('grunt-contrib-watch');
52 |
53 | grunt.registerTask('default', ['concat', 'uglify']);
54 |
55 | };
--------------------------------------------------------------------------------
/MIT-LICENSE.txt:
--------------------------------------------------------------------------------
1 | Copyright (c) 2010 Alexander Farkas, http://protofunc.com/
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining
4 | a copy of this software and associated documentation files (the
5 | "Software"), to deal in the Software without restriction, including
6 | without limitation the rights to use, copy, modify, merge, publish,
7 | distribute, sublicense, and/or sell copies of the Software, and to
8 | permit persons to whom the Software is furnished to do so, subject to
9 | the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be
12 | included in all copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--------------------------------------------------------------------------------
/build/compiler.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aFarkas/jMediaelement/d6d7391ad9695eab92ae725747488099f4eb75b0/build/compiler.jar
--------------------------------------------------------------------------------
/demo/default-style/css/player-styles.css:
--------------------------------------------------------------------------------
1 | button {
2 | overflow: visible;
3 | }
4 | button::-moz-focus-inner {
5 | padding:0;
6 | border:0;
7 | }
8 |
9 | /* default */
10 | html.jme-embedded-player,
11 | html.jme-embedded-player body {
12 | margin: 0;
13 | padding: 0;
14 | position: relative;
15 | width: 100%;
16 | height: 100%;
17 | overflow: hidden;
18 | background: #000;
19 | }
20 |
21 | html.jme-embedded-player .mediaplayer,
22 | html.jme-embedded-player .mediaplayer video {
23 | width: 100%;
24 | height: 100%;
25 | }
26 |
27 | .volume-slider,
28 | .time-slider {
29 | position: relative;
30 | font-size: 0;
31 | line-height: 0;
32 | zoom: 1;
33 | min-height: 1px;
34 | min-width: 1px;
35 | }
36 |
37 | .time-slider[aria-disabled="true"] {
38 | opacity: 0.6;
39 | }
40 |
41 | .volume-slider .ws-range-thumb,
42 | .time-slider .ws-range-thumb {
43 | position: absolute;
44 | display: block;
45 | min-height: 1px;
46 | min-width: 1px;
47 | background: #000;
48 | cursor: pointer;
49 | border-radius: 0;
50 | border: 0;
51 | }
52 |
53 | .volume-slider[aria-disabled="true"] .ws-range-thumb,
54 | .time-slider[aria-disabled="true"] .ws-range-thumb {
55 | cursor: default;
56 | }
57 |
58 | .buffer-progress {
59 | position: relative;
60 | zoom: 1;
61 | }
62 |
63 | .buffer-progress .buffer-progress-indicator {
64 | display: block;
65 | height: 100%;
66 | width: 0;
67 | left: 0;
68 | min-height: 1px;
69 | position: absolute;
70 | top: 0;
71 | background: #E3E3E3;
72 | }
73 |
74 | .time-slider .buffer-progress-indicator {
75 | cursor: pointer;
76 | }
77 |
78 | .jme-default-media-overlay {
79 | position: absolute;
80 | top: 0;
81 | left: 0;
82 | width: 100%;
83 | height: 100%;
84 | cursor: pointer;
85 | background: url("../img/loader.gif") no-repeat -9999px -9999px;
86 | }
87 |
88 | .state-playing .jme-default-media-overlay {
89 | background-image: none;
90 | }
91 |
92 | .state-waiting .jme-default-media-overlay {
93 | background-position: center;
94 | }
95 |
96 | .state-idle .jme-default-media-overlay,
97 | .state-ended .jme-default-media-overlay {
98 | background: url("../img/play-overlay.png") no-repeat center;
99 | }
100 | /* default end */
101 |
102 | .mediaplayer,
103 | video {
104 | position: relative;
105 | display: block;
106 | width: 512px;
107 | height: 288px;
108 | }
109 |
110 | .mediaplayer {
111 | height: auto;
112 | }
113 |
114 | .audioplayer {
115 | height: 160px;
116 | }
117 |
118 | .mediaplayer.ratio-16-9,
119 | .mediaplayer.ratio-4-3 {
120 | position: relative;
121 | height: 0;
122 | width: 100%;
123 | }
124 |
125 | .mediaplayer.ratio-16-9 {
126 | padding-bottom: 56.25%;
127 | }
128 |
129 | .mediaplayer.ratio-4-3 {
130 | padding-bottom: 75%;
131 | }
132 |
133 | .mediaplayer.ratio-16-9 video,
134 | .mediaplayer.ratio-16-9 .polyfill-video,
135 | .mediaplayer.ratio-4-3 video,
136 | .mediaplayer.ratio-4-3 .polyfill-video {
137 | position: absolute !important;
138 | top: 0;
139 | left: 0;
140 | width: 100% !important;
141 | height: 100% !important;
142 | }
143 |
144 | .jme-default-control-bar {
145 | position: absolute;
146 | left: 0;
147 | bottom: 10px;
148 | width: 100%;
149 | outline: none;
150 | }
151 |
152 | .mediaplayer .media-controls {
153 | max-width: 980px;
154 | margin: 0 auto;
155 | padding: 0 10px;
156 | -webkit-transition: all 400ms;
157 | transition: all 400ms;
158 | }
159 |
160 |
161 | .mediaplayer .currenttime-display,
162 | .mediaplayer .duration-display,
163 | .mediaplayer .time-select {
164 | font-family: monospace;
165 | }
166 |
167 | .videoplayer.state-playing .media-controls {
168 | -webkit-transform: translate(0, 60%);
169 | transform: translate(0, 60%);
170 | opacity: 0;
171 | }
172 | .no-opacity .videoplayer.state-playing .media-controls {
173 | visibility: hidden;
174 | }
175 | .videoplayer.useractive .media-controls {
176 | -webkit-transform: translate(0, 0);
177 | transform: translate(0, 0);
178 | opacity: 1;
179 | }
180 | .no-opacity .videoplayer.useractive .media-controls {
181 | visibility: visible;
182 | }
183 | .media-controls button {
184 | cursor: pointer;
185 | display: inline-block;
186 | overflow: visible;
187 | border: 0;
188 | padding: 0;
189 | border-radius: 5px;
190 | -webkit-appearance: none;
191 | background: url("../img/player-sprites.png") no-repeat 0 -200px;
192 | }
193 |
194 | .media-controls button:hover,
195 | .media-controls button:focus {
196 | background-position: 0 -300px;
197 | }
198 |
199 | .media-controls button:focus {
200 | outline: 1px dotted #666;
201 |
202 | }
203 |
204 | .media-controls .currenttime-display,
205 | .media-controls .duration-display {
206 | margin: 1px 0 0;
207 | }
208 |
209 | .media-controls button:active {
210 | background-position: 0 -400px;
211 | }
212 |
213 | .media-controls button .jme-icon {
214 | display: inline-block;
215 | vertical-align: top;
216 | width: 13px;
217 | height: 13px;
218 | background: url("../img/player-sprites.png") no-repeat -9999px -9999px;
219 | }
220 |
221 | .media-controls button .jme-text {
222 | position: absolute;
223 | left: -9999px;
224 | width: 0;
225 | overflow: hidden;
226 | }
227 |
228 | .media-controls button.play-pause {
229 | float: left;
230 | margin: 0 10px 0 0;
231 | height: 22px;
232 | width: 42px;
233 | }
234 |
235 | .media-controls button.play-pause .jme-icon {
236 | margin: 2px 0 0 2px;
237 | background-position: 0 -700px;
238 | }
239 |
240 | .media-controls button.play-pause.state-playing .jme-icon {
241 | background-position: 1px -799px;
242 | }
243 |
244 | .media-controls .media-bar {
245 | position: relative;
246 | margin: 0 0 0 55px;
247 | padding: 3px 5px 1px;
248 | height: 100%;
249 | min-height: 18px;
250 | border-radius: 5px 5px 5px 5px;
251 | color: #FFFFFF;
252 | font-size: 11px;
253 | background: url("../img/player-sprites.png") repeat-x scroll 0 0 #333333;
254 | }
255 |
256 | html > body .media-controls .media-bar {
257 | height: auto;
258 | background-color: transparent;
259 | }
260 | .media-controls .media-bar > * {
261 | float: left;
262 | }
263 |
264 | .media-controls .ws-range {
265 | position: relative;
266 | display: inline-block;
267 | vertical-align: middle;
268 | font-size: 0;
269 | outline: none;
270 | box-shdow: none;
271 | }
272 | .media-controls .ws-range-rail {
273 | position: absolute;
274 | display: block;
275 | top: 0;
276 | left: 0;
277 | right: 0;
278 | height: 100%;
279 | }
280 |
281 | .media-controls .time-slider {
282 | margin: 1px 10px 0;
283 | background: url("../img/player-sprites.png") repeat-x scroll 0 -104px #999999;
284 | border-radius: 3px 3px 3px 3px;
285 | height: 4px;
286 | padding: 1px;
287 | top: 3px;
288 | }
289 |
290 |
291 | .media-controls .time-slider .ws-range-thumb {
292 | background: url("../img/player-sprites.png") no-repeat scroll 0 -1099px transparent;
293 | height: 15px;
294 | margin: -5px 0 0 -2px;
295 | outline: medium none;
296 | top: 0;
297 | width: 5px;
298 | z-index: 9;
299 | }
300 |
301 |
302 | .media-controls .time-slider.ws-focus .ws-range-thumb,
303 | .media-controls .time-slider.ws-active .ws-range-thumb {
304 | background-position: 0 -1199px;
305 | }
306 |
307 | .media-controls .time-slider .ws-range-progress {
308 | position: absolute;
309 | height: 4px;
310 | background:#369;
311 | border-radius: 3px;
312 | cursor: pointer;
313 | left: 0;
314 | top: 0;
315 | box-shdow: none;
316 | }
317 |
318 | .media-controls .time-select {
319 | position: absolute;
320 | visibility: hidden;
321 | opacity: 0;
322 | top: -1.2em;
323 | background: #000;
324 | border-radius: 4px;
325 | color: #fff;
326 | display: inline-block;
327 | width: 3em;
328 | padding: 3px;
329 | margin: -6px 0 0 -1.5em;
330 | font-size: 12px;
331 | line-height: 14px;
332 | text-align: center;
333 | transition: opacity 400ms, visibility 400ms;
334 | }
335 |
336 | .media-controls .show-time-select {
337 | visibility: visible;
338 | opacity: 1;
339 | }
340 |
341 | .media-controls .buffer-progress {
342 | height: 100%;
343 | min-width: 40px;
344 | }
345 | .media-controls .buffer-progress .buffer-progress-indicator {
346 | background: #E3E3E3;
347 | border-radius: 3px 3px 3px 3px;
348 | cursor: pointer;
349 | }
350 |
351 | .media-controls .duration-display {
352 | margin: 0 10px 0 0;
353 | }
354 |
355 | .media-controls .volume-controls {
356 | width: 49px; /* IE7*/
357 | zoom: 1;
358 | overflow: hidden;
359 | }
360 |
361 | .media-controls .volume-controls > * {
362 | float: left;
363 | }
364 |
365 | .media-controls .volume-slider {
366 | background: url("../img/player-sprites.png") no-repeat scroll 1px -599px transparent;
367 | cursor: pointer;
368 | height: 14px;
369 | top: 1px;
370 | width: 30px;
371 | margin: 0 0 0 3px;
372 | }
373 |
374 | .media-controls .volume-slider .ws-range-progress {
375 | position: absolute;
376 | background: url("../img/player-sprites.png") no-repeat scroll 1px -499px transparent;
377 | height: 100%;
378 | left: 0;
379 | min-height: 1px;
380 | min-width: 1px;
381 | top: 0;
382 | box-shdow: none;
383 | }
384 |
385 | .state-muted .media-controls .volume-slider .ws-range-progress {
386 | visibility: hidden;
387 | }
388 |
389 | /*.state-muted .media-controls .volume-slider .ui-slider-handle {
390 | left: 0 !important;
391 | }*/
392 |
393 | .media-controls .volume-slider .ws-range-thumb {
394 | top: 0;
395 | left: 0;
396 | height: 100%;
397 | width: 1px;
398 | background: none;
399 | }
400 |
401 | .media-controls .mute-unmute .jme-icon {
402 | margin: 0 2px 1px 1px;
403 | background-position: 2px -1397px;
404 | }
405 |
406 | .media-controls .mute-unmute.state-unmute .jme-icon {
407 | background-position: 2px -1497px;
408 | }
409 |
410 | .media-controls .fullscreen {
411 | margin-left: 5px;
412 | }
413 |
414 | .no-fullwindow .fullscreen {
415 | display: none;
416 | }
417 |
418 | .media-controls .fullscreen,
419 | .media-controls .mute-unmute {
420 | width: 16px;
421 | height: 16px;
422 | }
423 |
424 | .media-controls .fullscreen .jme-icon {
425 | margin: 0 2px 1px 1px;
426 | background-position: 2px -897px;
427 | }
428 |
429 | .media-controls .fullscreen.state-exitfullscreen .jme-icon {
430 | background-position: 2px -997px;
431 | }
432 |
433 | html.has-media-fullscreen,
434 | body.has-media-fullscreen {
435 | overflow: hidden;
436 | }
437 |
438 | .player-fullscreen {
439 | position: fixed !important;
440 | z-index: 999999;
441 | background: #000;
442 | }
443 |
444 | .mediaplayer.player-fullscreen.state-playing.userinactive,
445 | .mediaplayer.player-fullscreen.state-playing.userinactive * {
446 | cursor: none !important;
447 | }
448 |
449 | .media-fullscreen,
450 | .player-fullscreen .polyfill-mediaelement,
451 | .player-fullscreen {
452 | top: 0 !important;
453 | left: 0 !important;
454 | right: 0 !important;
455 | bottom: 0 !important;
456 | width: 100% !important;
457 | height: 100% !important;
458 | padding: 0 !important;
459 | margin: 0 !important;
460 | }
461 |
462 | .media-fullscreen {
463 | position: relative;
464 | }
465 |
466 | .media-controls .subtitle-controls {
467 | position: relative;
468 | zoom: 1;
469 | margin-left: 5px;
470 | display: none;
471 | }
472 |
473 | .media-controls .subtitle-controls .subtitle-menu {
474 | position: absolute;
475 | bottom: 20px;
476 | right: 0px;
477 | overflow: hidden;
478 | min-width: 130px;
479 | max-width: 400px;
480 | }
481 |
482 | .has-track .media-controls .subtitle-controls {
483 | display: block;
484 | }
485 |
486 | .media-controls .subtitle-menu div {
487 | color: #fff;
488 | background: #000;
489 | background: rgba(0, 0, 0, 0.7);
490 | border-radius: 8px;
491 | padding: 5px;
492 | visibility: hidden;
493 | }
494 |
495 | .media-controls .subtitle-menu.visible-menu div {
496 | visibility: visible;
497 | }
498 |
499 | .media-controls .subtitle-menu ul {
500 | padding: 0;
501 | margin: 0;
502 | list-style: none;
503 | }
504 |
505 | .media-controls .subtitle-menu button {
506 | background: none;
507 | color: #fff;
508 | padding: 2px;
509 | margin: 1px 0;
510 | white-space: nowrap;
511 | }
512 |
513 | .media-controls .subtitle-menu button:before {
514 | content: '';
515 | display: inline-block;
516 | margin: -0.1em 3px 0 0;
517 | vertical-align: middle;
518 | width: 5px;
519 | height: 5px;
520 | border: 1px solid #ccc;
521 | border-radius: 50%;
522 | }
523 |
524 | .media-controls .subtitle-menu button[aria-checked="true"] {
525 | text-decoration: underline;
526 | }
527 |
528 | .media-controls .subtitle-menu button[aria-checked="true"]:before {
529 | background: #fff;
530 | }
531 |
532 | .media-controls .captions .jme-icon {
533 | width: 16px;
534 | height: 16px;
535 | background-position: 3px -1797px;
536 | }
537 |
538 | .media-controls .captions[role="checkbox"] {
539 | display: none;
540 | }
541 |
542 | /*for checkbox captions
543 | [data-tracks="1"] .media-controls .captions[role="checkbox"] {
544 | display: inline-block;
545 | }
546 |
547 | [data-tracks="1"] .media-controls .captions[role="checkbox"] + .captions {
548 | display: none;
549 | }
550 | */
551 |
552 | .audioplayer .media-controls .fullscreen,
553 | .mobile .media-controls .volume-controls,
554 | .mobile.no-fullscreen .media-controls .fullscreen {
555 | display: none;
556 | }
557 |
--------------------------------------------------------------------------------
/demo/default-style/img/dev/play-overlay.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aFarkas/jMediaelement/d6d7391ad9695eab92ae725747488099f4eb75b0/demo/default-style/img/dev/play-overlay.png
--------------------------------------------------------------------------------
/demo/default-style/img/dev/player-sprites.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aFarkas/jMediaelement/d6d7391ad9695eab92ae725747488099f4eb75b0/demo/default-style/img/dev/player-sprites.png
--------------------------------------------------------------------------------
/demo/default-style/img/loader.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aFarkas/jMediaelement/d6d7391ad9695eab92ae725747488099f4eb75b0/demo/default-style/img/loader.gif
--------------------------------------------------------------------------------
/demo/default-style/img/play-overlay.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aFarkas/jMediaelement/d6d7391ad9695eab92ae725747488099f4eb75b0/demo/default-style/img/play-overlay.png
--------------------------------------------------------------------------------
/demo/default-style/img/player-sprites.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aFarkas/jMediaelement/d6d7391ad9695eab92ae725747488099f4eb75b0/demo/default-style/img/player-sprites.png
--------------------------------------------------------------------------------
/demo/embedded-player.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
27 |
28 |
29 |
38 | mediaplayer
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/demo/font-style.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
80 |
81 |
82 |
95 | jme2
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
119 |
120 |
121 |
122 |
123 |
--------------------------------------------------------------------------------
/demo/font-style/css/player-styles.css:
--------------------------------------------------------------------------------
1 | @font-face {
2 | font-family: 'FontAwesome';
3 | src: url('../fonts/fontawesome-webfont.eot?v=3.0.1');
4 | src: url('../fonts/fontawesome-webfont.eot?#iefix&v=3.0.1') format('embedded-opentype'),
5 | url('../fonts/fontawesome-webfont.woff?v=3.0.1') format('woff'),
6 | url('../fonts/fontawesome-webfont.ttf?v=3.0.1') format('truetype');
7 | font-weight: normal;
8 | font-style: normal;
9 | }
10 |
11 | button {
12 | overflow: visible;
13 | }
14 | button::-moz-focus-inner {
15 | padding:0;
16 | border:0;
17 | }
18 |
19 | .fontawsome-icon,
20 | .jme-default-media-overlay,
21 | .media-controls button.play-pause {
22 | font-family: FontAwesome;
23 | font-weight: normal;
24 | font-style: normal;
25 | text-decoration: inherit;
26 | -webkit-font-smoothing: antialiased;
27 | line-height: normal;
28 | }
29 |
30 |
31 |
32 | @keyframes spin {
33 | 0% { transform: rotate(0deg); }
34 | 100% { transform: rotate(359deg); }
35 | }
36 |
37 | /* default */
38 | html.jme-embedded-player,
39 | html.jme-embedded-player body {
40 | margin: 0;
41 | padding: 0;
42 | position: relative;
43 | width: 100%;
44 | height: 100%;
45 | overflow: hidden;
46 | background: #000;
47 | }
48 |
49 | html.jme-embedded-player .mediaplayer,
50 | html.jme-embedded-player .mediaplayer video {
51 | width: 100%;
52 | height: 100%;
53 | }
54 |
55 | .volume-slider,
56 | .time-slider {
57 | position: relative;
58 | font-size: 0;
59 | line-height: 0;
60 | zoom: 1;
61 | min-height: 1px;
62 | min-width: 1px;
63 | }
64 |
65 | .time-slider[aria-disabled="true"] {
66 | opacity: 0.6;
67 | }
68 |
69 | .volume-slider .ws-range-thumb,
70 | .time-slider .ws-range-thumb {
71 | position: absolute;
72 | display: block;
73 | min-height: 1px;
74 | min-width: 1px;
75 | background: #000;
76 | cursor: pointer;
77 | }
78 |
79 | .volume-slider[aria-disabled="true"] .ws-range-thumb,
80 | .time-slider[aria-disabled="true"] .ws-range-thumb {
81 | cursor: default;
82 | }
83 |
84 | .buffer-progress {
85 | position: relative;
86 | zoom: 1;
87 | }
88 |
89 | .buffer-progress .buffer-progress-indicator {
90 | display: block;
91 | height: 100%;
92 | width: 0;
93 | left: 0;
94 | min-height: 1px;
95 | position: absolute;
96 | top: 0;
97 | background: #E3E3E3;
98 | }
99 |
100 | .time-slider .buffer-progress-indicator {
101 | cursor: pointer;
102 | }
103 |
104 | .jme-default-media-overlay {
105 | position: absolute;
106 | top: 0;
107 | left: 0;
108 | width: 100%;
109 | height: 100%;
110 | cursor: pointer;
111 | font-size: 450%;
112 | }
113 |
114 | .jme-default-media-overlay:before {
115 | position: absolute;
116 | top: 100px;
117 | left: 50%;
118 | margin: 0 0 0 -0.5em;
119 | }
120 |
121 | .state-waiting .jme-default-media-overlay:before {
122 | content: "\f02d";
123 | }
124 |
125 | .state-idle .jme-default-media-overlay:before,
126 | .state-ended .jme-default-media-overlay:before {
127 | content: "\f022";
128 | }
129 | /* default end */
130 |
131 | .mediaplayer,
132 | video {
133 | position: relative;
134 | display: block;
135 | width: 512px;
136 | height: 288px;
137 | }
138 |
139 | .mediaplayer {
140 | height: auto;
141 | font-size: 16px;
142 | }
143 |
144 | .audioplayer {
145 | height: 160px;
146 | }
147 |
148 | .mediaplayer.ratio-16-9,
149 | .mediaplayer.ratio-4-3 {
150 | position: relative;
151 | height: 0;
152 | width: 100%;
153 | }
154 |
155 | .mediaplayer.ratio-16-9 {
156 | padding-bottom: 56.25%;
157 | }
158 |
159 | .mediaplayer.ratio-4-3 {
160 | padding-bottom: 75%;
161 | }
162 |
163 | .mediaplayer.ratio-16-9 video,
164 | .mediaplayer.ratio-16-9 .polyfill-video,
165 | .mediaplayer.ratio-4-3 video,
166 | .mediaplayer.ratio-4-3 .polyfill-video {
167 | position: absolute !important;
168 | top: 0;
169 | left: 0;
170 | width: 100% !important;
171 | height: 100% !important;
172 | }
173 |
174 | .jme-default-control-bar {
175 | position: absolute;
176 | left: 0;
177 | bottom: 0;
178 | right: 0;
179 | outline: none;
180 | }
181 |
182 | .mediaplayer .media-controls {
183 | position: relative;
184 | zoom: 1;
185 | margin: 0 auto;
186 | padding: 10px;
187 | -webkit-transition: all 400ms;
188 | transition: all 400ms;
189 | background: #000;
190 | background: rgba(0, 0, 0, 0.6);
191 | }
192 |
193 |
194 | .mediaplayer .currenttime-display,
195 | .mediaplayer .duration-display,
196 | .mediaplayer .time-select {
197 | font-family: monospace;
198 | }
199 |
200 | .videoplayer.state-playing .media-controls {
201 | opacity: 0;
202 | }
203 | .no-opacity .videoplayer.state-playing .media-controls {
204 | visibility: hidden;
205 | }
206 | .videoplayer.useractive .media-controls {
207 | opacity: 1;
208 | }
209 | .no-opacity .videoplayer.useractive .media-controls {
210 | visibility: visible;
211 | }
212 | .media-controls button {
213 | cursor: pointer;
214 | display: inline-block;
215 | overflow: visible;
216 | border: 0;
217 | padding: 0;
218 | -webkit-appearance: none;
219 | background: transparent;
220 | color: #fff;
221 | }
222 |
223 | .media-controls button:hover,
224 | .media-controls button:focus {
225 | background-position: 0 -300px;
226 | }
227 |
228 | .media-controls button:focus {
229 | outline: 1px dotted #666;
230 |
231 | }
232 |
233 | .media-controls .currenttime-display,
234 | .media-controls .duration-display {
235 | margin: 1px 0 0;
236 | }
237 |
238 | .media-controls button:active {
239 | background-position: 0 -400px;
240 | }
241 |
242 | .media-controls button .jme-icon {
243 | display: none;
244 | }
245 |
246 | .media-controls button .jme-text {
247 | position: absolute;
248 | left: -9999px;
249 | width: 0;
250 | overflow: hidden;
251 | font: arial;
252 | }
253 |
254 | .media-controls button.play-pause {
255 | float: left;
256 | margin: 0 10px 0 0;
257 | height: 22px;
258 | width: 42px;
259 | }
260 |
261 | .media-controls button.play-pause:before {
262 | content: "\f029";
263 | }
264 |
265 | .media-controls button.play-pause.state-playing:before {
266 | content: "\f02a";
267 | }
268 |
269 | .media-controls .media-bar > * {
270 | float: left;
271 | }
272 |
273 | .media-controls .ws-range {
274 | position: relative;
275 | display: inline-block;
276 | vertical-align: middle;
277 | font-size: 0;
278 | outline: none;
279 | background: #fff;
280 | background: rgba(255, 255, 255, 0.6);
281 | height: 4px;
282 | padding: 0;
283 | cursor: pointer;
284 | }
285 | .media-controls .ws-range-rail {
286 | position: absolute;
287 | display: block;
288 | top: 0;
289 | left: 0;
290 | right: 0;
291 | height: 100%;
292 | }
293 |
294 |
295 | .media-controls .ws-range-thumb {
296 | background: #fff;
297 | height: 15px;
298 | margin: -5px 0 0 -2px;
299 | top: 0;
300 | width: 5px;
301 | z-index: 9;
302 | }
303 |
304 | .media-controls .time-slider {
305 | position: absolute;
306 | top: 0;
307 | left: 0;
308 | right: 0;
309 | top: 0;
310 | }
311 |
312 | .media-controls .time-slider .ws-range-progress {
313 | position: absolute;
314 | height: 4px;
315 | background:#369;
316 | border-radius: 3px;
317 | cursor: pointer;
318 | left: 0;
319 | top: 0;
320 | }
321 |
322 | .media-controls .time-select {
323 | position: absolute;
324 | visibility: hidden;
325 | opacity: 0;
326 | top: -1.2em;
327 | background: #000;
328 | border-radius: 4px;
329 | color: #fff;
330 | display: inline-block;
331 | width: 3em;
332 | padding: 3px;
333 | margin: -6px 0 0 -1.5em;
334 | font-size: 12px;
335 | line-height: 14px;
336 | text-align: center;
337 | transition: opacity 400ms, visibility 400ms;
338 | }
339 |
340 | .media-controls .show-time-select {
341 | visibility: visible;
342 | opacity: 1;
343 | }
344 |
345 | .media-controls .buffer-progress {
346 | height: 100%;
347 | min-width: 40px;
348 | }
349 | .media-controls .buffer-progress .buffer-progress-indicator {
350 | background: #E3E3E3;
351 | border-radius: 3px 3px 3px 3px;
352 | cursor: pointer;
353 | }
354 |
355 | .media-controls .duration-display {
356 | margin: 0 10px 0 0;
357 | }
358 |
359 | .media-controls .volume-controls {
360 | width: 49px; /* IE7*/
361 | zoom: 1;
362 | overflow: hidden;
363 | }
364 |
365 | .media-controls .volume-controls > * {
366 | float: left;
367 | }
368 |
369 | .media-controls .volume-slider {
370 | background: url("../img/player-sprites.png") no-repeat scroll 1px -599px transparent;
371 | cursor: pointer;
372 | height: 14px;
373 | top: 1px;
374 | width: 30px;
375 | margin: 0 0 0 3px;
376 | }
377 |
378 | .media-controls .volume-slider .ws-range-progress {
379 | position: absolute;
380 | background: url("../img/player-sprites.png") no-repeat scroll 1px -499px transparent;
381 | height: 100%;
382 | left: 0;
383 | min-height: 1px;
384 | min-width: 1px;
385 | top: 0;
386 | }
387 |
388 | .state-muted .media-controls .volume-slider .ws-range-progress {
389 | visibility: hidden;
390 | }
391 |
392 | /*.state-muted .media-controls .volume-slider .ui-slider-handle {
393 | left: 0 !important;
394 | }*/
395 |
396 | .media-controls .volume-slider .ws-range-thumb {
397 | top: 0;
398 | left: 0;
399 | height: 100%;
400 | width: 1px;
401 | background: none;
402 | }
403 |
404 | .media-controls .mute-unmute .jme-icon {
405 | margin: 0 2px 1px 1px;
406 | background-position: 2px -1397px;
407 | }
408 |
409 | .media-controls .mute-unmute.state-unmute .jme-icon {
410 | background-position: 2px -1497px;
411 | }
412 |
413 | .media-controls .fullscreen {
414 | margin-left: 5px;
415 | }
416 |
417 | .no-fullwindow .fullscreen {
418 | display: none;
419 | }
420 |
421 | .media-controls .fullscreen,
422 | .media-controls .mute-unmute {
423 | width: 16px;
424 | height: 16px;
425 | }
426 |
427 | .media-controls .fullscreen .jme-icon {
428 | margin: 0 2px 1px 1px;
429 | background-position: 2px -897px;
430 | }
431 |
432 | .media-controls .fullscreen.state-exitfullscreen .jme-icon {
433 | background-position: 2px -997px;
434 | }
435 |
436 | html.has-media-fullscreen,
437 | body.has-media-fullscreen {
438 | overflow: hidden;
439 | }
440 |
441 | .player-fullscreen {
442 | position: fixed !important;
443 | z-index: 999999;
444 | background: #000;
445 | }
446 |
447 | .mediaplayer.player-fullscreen.state-playing.userinactive,
448 | .mediaplayer.player-fullscreen.state-playing.userinactive * {
449 | cursor: none !important;
450 | }
451 |
452 | .media-fullscreen,
453 | .player-fullscreen .polyfill-mediaelement,
454 | .player-fullscreen {
455 | top: 0 !important;
456 | left: 0 !important;
457 | right: 0 !important;
458 | bottom: 0 !important;
459 | width: 100% !important;
460 | height: 100% !important;
461 | padding: 0 !important;
462 | margin: 0 !important;
463 | }
464 |
465 | .media-fullscreen {
466 | position: relative;
467 | }
468 |
469 | .media-controls .subtitle-controls {
470 | position: relative;
471 | zoom: 1;
472 | margin-left: 5px;
473 | display: none;
474 | }
475 |
476 | .media-controls .subtitle-controls .subtitle-menu {
477 | position: absolute;
478 | bottom: 20px;
479 | right: 0px;
480 | overflow: hidden;
481 | min-width: 130px;
482 | max-width: 400px;
483 | }
484 |
485 | .has-track .media-controls .subtitle-controls {
486 | display: block;
487 | }
488 |
489 | .media-controls .subtitle-menu div {
490 | color: #fff;
491 | background: #000;
492 | background: rgba(0, 0, 0, 0.7);
493 | border-radius: 8px;
494 | padding: 5px;
495 | visibility: hidden;
496 | }
497 |
498 | .media-controls .subtitle-menu.visible-menu div {
499 | visibility: visible;
500 | }
501 |
502 | .media-controls .subtitle-menu ul {
503 | padding: 0;
504 | margin: 0;
505 | list-style: none;
506 | }
507 |
508 | .media-controls .subtitle-menu button {
509 | background: none;
510 | color: #fff;
511 | padding: 2px;
512 | margin: 1px 0;
513 | white-space: nowrap;
514 | }
515 |
516 | .media-controls .subtitle-menu button:before {
517 | content: '';
518 | display: inline-block;
519 | margin: -0.1em 3px 0 0;
520 | vertical-align: middle;
521 | width: 5px;
522 | height: 5px;
523 | border: 1px solid #ccc;
524 | border-radius: 50%;
525 | }
526 |
527 | .media-controls .subtitle-menu button[aria-checked="true"] {
528 | text-decoration: underline;
529 | }
530 |
531 | .media-controls .subtitle-menu button[aria-checked="true"]:before {
532 | background: #fff;
533 | }
534 |
535 | .media-controls .captions .jme-icon {
536 | width: 16px;
537 | height: 16px;
538 | background-position: 3px -1797px;
539 | }
540 |
541 | .audioplayer .media-controls .fullscreen,
542 | .mobile .media-controls .volume-controls,
543 | .mobile.no-fullscreen .media-controls .fullscreen {
544 | display: none;
545 | }
546 |
--------------------------------------------------------------------------------
/demo/font-style/fonts/fontawesome-ie7.css:
--------------------------------------------------------------------------------
1 | /*!
2 | * Font Awesome 3.0.2
3 | * the iconic font designed for use with Twitter Bootstrap
4 | * -------------------------------------------------------
5 | * The full suite of pictographic icons, examples, and documentation
6 | * can be found at: http://fortawesome.github.com/Font-Awesome/
7 | *
8 | * License
9 | * -------------------------------------------------------
10 | * - The Font Awesome font is licensed under the SIL Open Font License - http://scripts.sil.org/OFL
11 | * - Font Awesome CSS, LESS, and SASS files are licensed under the MIT License -
12 | * http://opensource.org/licenses/mit-license.html
13 | * - The Font Awesome pictograms are licensed under the CC BY 3.0 License - http://creativecommons.org/licenses/by/3.0/
14 | * - Attribution is no longer required in Font Awesome 3.0, but much appreciated:
15 | * "Font Awesome by Dave Gandy - http://fortawesome.github.com/Font-Awesome"
16 |
17 | * Contact
18 | * -------------------------------------------------------
19 | * Email: dave@davegandy.com
20 | * Twitter: http://twitter.com/fortaweso_me
21 | * Work: Lead Product Designer @ http://kyruus.com
22 | */.icon-large{font-size:1.3333333333333333em;margin-top:-4px;padding-top:3px;margin-bottom:-4px;padding-bottom:3px;vertical-align:middle}.nav [class^="icon-"],.nav [class*=" icon-"]{vertical-align:inherit;margin-top:-4px;padding-top:3px;margin-bottom:-4px;padding-bottom:3px}.nav [class^="icon-"].icon-large,.nav [class*=" icon-"].icon-large{vertical-align:-25%}.nav-pills [class^="icon-"].icon-large,.nav-tabs [class^="icon-"].icon-large,.nav-pills [class*=" icon-"].icon-large,.nav-tabs [class*=" icon-"].icon-large{line-height:.75em;margin-top:-7px;padding-top:5px;margin-bottom:-5px;padding-bottom:4px}.btn [class^="icon-"].pull-left,.btn [class*=" icon-"].pull-left,.btn [class^="icon-"].pull-right,.btn [class*=" icon-"].pull-right{vertical-align:inherit}.btn [class^="icon-"].icon-large,.btn [class*=" icon-"].icon-large{margin-top:-0.5em}a [class^="icon-"],a [class*=" icon-"]{cursor:pointer}ul.icons{text-indent:-1.5em;margin-left:3em}.icon-remove { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '0xf021; '); }
23 | .icon-play-circle { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '0xf022; '); }
24 | .icon-repeat { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '0xf023; '); }
25 | .icon-volume-off { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '0xf024; '); }
26 | .icon-volume-down { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '0xf025; '); }
27 | .icon-volume-up { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '0xf026; '); }
28 | .icon-share { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '0xf027; '); }
29 | .icon-check { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '0xf028; '); }
30 | .icon-play { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '0xf029; '); }
31 | .icon-pause { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '0xf02a; '); }
32 | .icon-resize-full { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '0xf02b; '); }
33 | .icon-resize-small { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '0xf02c; '); }
34 | .icon-spinner { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '0xf02d; '); }
35 |
--------------------------------------------------------------------------------
/demo/font-style/fonts/fontawesome-ie7.less:
--------------------------------------------------------------------------------
1 | /*!
2 | * Font Awesome 3.0.2
3 | * the iconic font designed for use with Twitter Bootstrap
4 | * -------------------------------------------------------
5 | * The full suite of pictographic icons, examples, and documentation
6 | * can be found at: http://fortawesome.github.com/Font-Awesome/
7 | *
8 | * License
9 | * -------------------------------------------------------
10 | * - The Font Awesome font is licensed under the SIL Open Font License - http://scripts.sil.org/OFL
11 | * - Font Awesome CSS, LESS, and SASS files are licensed under the MIT License -
12 | * http://opensource.org/licenses/mit-license.html
13 | * - The Font Awesome pictograms are licensed under the CC BY 3.0 License - http://creativecommons.org/licenses/by/3.0/
14 | * - Attribution is no longer required in Font Awesome 3.0, but much appreciated:
15 | * "Font Awesome by Dave Gandy - http://fortawesome.github.com/Font-Awesome"
16 |
17 | * Contact
18 | * -------------------------------------------------------
19 | * Email: dave@davegandy.com
20 | * Twitter: http://twitter.com/fortaweso_me
21 | * Work: Lead Product Designer @ http://kyruus.com
22 | */
23 |
24 | .icon-large {
25 | font-size: 4/3em;
26 | margin-top: -4px;
27 | padding-top: 3px;
28 | margin-bottom: -4px;
29 | padding-bottom: 3px;
30 | vertical-align: middle;
31 | }
32 |
33 | .nav {
34 | [class^="icon-"],
35 | [class*=" icon-"] {
36 | vertical-align: inherit;
37 | margin-top: -4px;
38 | padding-top: 3px;
39 | margin-bottom: -4px;
40 | padding-bottom: 3px;
41 | &.icon-large {
42 | vertical-align: -25%;
43 | }
44 | }
45 | }
46 |
47 | .nav-pills, .nav-tabs {
48 | [class^="icon-"],
49 | [class*=" icon-"] {
50 | &.icon-large {
51 | line-height: .75em;
52 | margin-top: -7px;
53 | padding-top: 5px;
54 | margin-bottom: -5px;
55 | padding-bottom: 4px;
56 | }
57 | }
58 | }
59 |
60 | .btn {
61 | [class^="icon-"],
62 | [class*=" icon-"] {
63 | &.pull-left, &.pull-right { vertical-align: inherit; }
64 | &.icon-large {
65 | margin-top: -.5em;
66 | }
67 | }
68 | }
69 |
70 | a [class^="icon-"],
71 | a [class*=" icon-"] {
72 | cursor: pointer;
73 | }
74 |
75 | ul.icons {
76 | text-indent: -1.5em;
77 | margin-left: 3em;
78 | }
79 |
80 |
81 | .ie7icon(@inner) {
82 | *zoom: ~"expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '@{inner}')";
83 | }.icon-remove { .ie7icon(''); }
84 | .icon-play-circle { .ie7icon(''); }
85 | .icon-repeat { .ie7icon(''); }
86 | .icon-volume-off { .ie7icon(''); }
87 | .icon-volume-down { .ie7icon(''); }
88 | .icon-volume-up { .ie7icon(''); }
89 | .icon-share { .ie7icon(''); }
90 | .icon-check { .ie7icon(''); }
91 | .icon-play { .ie7icon(''); }
92 | .icon-pause { .ie7icon(''); }
93 | .icon-resize-full { .ie7icon(''); }
94 | .icon-resize-small { .ie7icon(''); }
95 | .icon-spinner { .ie7icon(''); }
96 |
--------------------------------------------------------------------------------
/demo/font-style/fonts/fontawesome-webfont.afm:
--------------------------------------------------------------------------------
1 | StartFontMetrics 2.0
2 | Comment Generated by FontForge 20110222
3 | Comment Creation Date: Sun Sep 22 04:10:28 2013
4 | FontName fontawesome
5 | FullName fontawesome
6 | FamilyName fontawesome
7 | Weight Book
8 | Notice (Created by root with FontForge 2.0 (http://fontforge.sf.net))
9 | ItalicAngle 0
10 | IsFixedPitch false
11 | UnderlinePosition -170.667
12 | UnderlineThickness 85.3333
13 | Version 001.000
14 | EncodingScheme ISO10646-1
15 | FontBBox 0 -80 975 900
16 | Descender -2147483648
17 | StartCharMetrics 13
18 | C -1 ; WX 824 ; N remove ; B 64 -11 761 686 ;
19 | C -1 ; WX 899 ; N play-circle ; B 0 -75 900 825 ;
20 | C -1 ; WX 899 ; N repeat ; B 0 -75 900 825 ;
21 | C -1 ; WX 449 ; N volume-off ; B 0 18 450 732 ;
22 | C -1 ; WX 674 ; N volume-down ; B 0 18 675 732 ;
23 | C -1 ; WX 974 ; N volume-up ; B 0 -42 975 792 ;
24 | C -1 ; WX 974 ; N share ; B 0 0 975 900 ;
25 | C -1 ; WX 974 ; N check ; B 0 0 975 825 ;
26 | C -1 ; WX 824 ; N play ; B 0 -80 825 830 ;
27 | C -1 ; WX 899 ; N pause ; B 0 -75 900 825 ;
28 | C -1 ; WX 899 ; N resize-full ; B 0 -75 900 825 ;
29 | C -1 ; WX 899 ; N resize-small ; B 7 -68 893 818 ;
30 | C -1 ; WX 918 ; N spinner ; B 0 -75 900 863 ;
31 | EndCharMetrics
32 | EndFontMetrics
33 |
--------------------------------------------------------------------------------
/demo/font-style/fonts/fontawesome-webfont.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aFarkas/jMediaelement/d6d7391ad9695eab92ae725747488099f4eb75b0/demo/font-style/fonts/fontawesome-webfont.eot
--------------------------------------------------------------------------------
/demo/font-style/fonts/fontawesome-webfont.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aFarkas/jMediaelement/d6d7391ad9695eab92ae725747488099f4eb75b0/demo/font-style/fonts/fontawesome-webfont.ttf
--------------------------------------------------------------------------------
/demo/font-style/fonts/fontawesome-webfont.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aFarkas/jMediaelement/d6d7391ad9695eab92ae725747488099f4eb75b0/demo/font-style/fonts/fontawesome-webfont.woff
--------------------------------------------------------------------------------
/demo/font-style/fonts/fontawesome.css:
--------------------------------------------------------------------------------
1 | /*!
2 | * Font Awesome 3.0.2
3 | * the iconic font designed for use with Twitter Bootstrap
4 | * -------------------------------------------------------
5 | * The full suite of pictographic icons, examples, and documentation
6 | * can be found at: http://fortawesome.github.com/Font-Awesome/
7 | *
8 | * License
9 | * -------------------------------------------------------
10 | * - The Font Awesome font is licensed under the SIL Open Font License - http://scripts.sil.org/OFL
11 | * - Font Awesome CSS, LESS, and SASS files are licensed under the MIT License -
12 | * http://opensource.org/licenses/mit-license.html
13 | * - The Font Awesome pictograms are licensed under the CC BY 3.0 License - http://creativecommons.org/licenses/by/3.0/
14 | * - Attribution is no longer required in Font Awesome 3.0, but much appreciated:
15 | * "Font Awesome by Dave Gandy - http://fortawesome.github.com/Font-Awesome"
16 |
17 | * Contact
18 | * -------------------------------------------------------
19 | * Email: dave@davegandy.com
20 | * Twitter: http://twitter.com/fortaweso_me
21 | * Work: Lead Product Designer @ http://kyruus.com
22 | */
23 | @font-face {
24 | font-family: 'FontAwesome';
25 | src: url('fontawesome-webfont.eot?v=3.0.1');
26 | src: url('fontawesome-webfont.eot?#iefix&v=3.0.1') format('embedded-opentype'),
27 | url('fontawesome-webfont.woff?v=3.0.1') format('woff'),
28 | url('fontawesome-webfont.ttf?v=3.0.1') format('truetype');
29 | font-weight: normal;
30 | font-style: normal;
31 | }
32 | /* Font Awesome styles
33 | ------------------------------------------------------- */
34 | [class^="icon-"],
35 | [class*=" icon-"] {
36 | font-family: FontAwesome;
37 | font-weight: normal;
38 | font-style: normal;
39 | text-decoration: inherit;
40 | -webkit-font-smoothing: antialiased;
41 |
42 | /* sprites.less reset */
43 | display: inline;
44 | width: auto;
45 | height: auto;
46 | line-height: normal;
47 | vertical-align: baseline;
48 | background-image: none;
49 | background-position: 0% 0%;
50 | background-repeat: repeat;
51 | margin-top: 0;
52 | }
53 | /* more sprites.less reset */
54 | .icon-white,
55 | .nav-pills > .active > a > [class^="icon-"],
56 | .nav-pills > .active > a > [class*=" icon-"],
57 | .nav-list > .active > a > [class^="icon-"],
58 | .nav-list > .active > a > [class*=" icon-"],
59 | .navbar-inverse .nav > .active > a > [class^="icon-"],
60 | .navbar-inverse .nav > .active > a > [class*=" icon-"],
61 | .dropdown-menu > li > a:hover > [class^="icon-"],
62 | .dropdown-menu > li > a:hover > [class*=" icon-"],
63 | .dropdown-menu > .active > a > [class^="icon-"],
64 | .dropdown-menu > .active > a > [class*=" icon-"],
65 | .dropdown-submenu:hover > a > [class^="icon-"],
66 | .dropdown-submenu:hover > a > [class*=" icon-"] {
67 | background-image: none;
68 | }
69 | [class^="icon-"]:before,
70 | [class*=" icon-"]:before {
71 | text-decoration: inherit;
72 | display: inline-block;
73 | speak: none;
74 | }
75 | /* makes sure icons active on rollover in links */
76 | a [class^="icon-"],
77 | a [class*=" icon-"] {
78 | display: inline-block;
79 | }
80 | /* makes the font 33% larger relative to the icon container */
81 | .icon-large:before {
82 | vertical-align: -10%;
83 | font-size: 1.3333333333333333em;
84 | }
85 | .btn [class^="icon-"],
86 | .nav [class^="icon-"],
87 | .btn [class*=" icon-"],
88 | .nav [class*=" icon-"] {
89 | display: inline;
90 | /* keeps button heights with and without icons the same */
91 |
92 | }
93 | .btn [class^="icon-"].icon-large,
94 | .nav [class^="icon-"].icon-large,
95 | .btn [class*=" icon-"].icon-large,
96 | .nav [class*=" icon-"].icon-large {
97 | line-height: .9em;
98 | }
99 | .btn [class^="icon-"].icon-spin,
100 | .nav [class^="icon-"].icon-spin,
101 | .btn [class*=" icon-"].icon-spin,
102 | .nav [class*=" icon-"].icon-spin {
103 | display: inline-block;
104 | }
105 | .nav-tabs [class^="icon-"],
106 | .nav-pills [class^="icon-"],
107 | .nav-tabs [class*=" icon-"],
108 | .nav-pills [class*=" icon-"] {
109 | /* keeps button heights with and without icons the same */
110 |
111 | }
112 | .nav-tabs [class^="icon-"],
113 | .nav-pills [class^="icon-"],
114 | .nav-tabs [class*=" icon-"],
115 | .nav-pills [class*=" icon-"],
116 | .nav-tabs [class^="icon-"].icon-large,
117 | .nav-pills [class^="icon-"].icon-large,
118 | .nav-tabs [class*=" icon-"].icon-large,
119 | .nav-pills [class*=" icon-"].icon-large {
120 | line-height: .9em;
121 | }
122 | li [class^="icon-"],
123 | .nav li [class^="icon-"],
124 | li [class*=" icon-"],
125 | .nav li [class*=" icon-"] {
126 | display: inline-block;
127 | width: 1.25em;
128 | text-align: center;
129 | }
130 | li [class^="icon-"].icon-large,
131 | .nav li [class^="icon-"].icon-large,
132 | li [class*=" icon-"].icon-large,
133 | .nav li [class*=" icon-"].icon-large {
134 | /* increased font size for icon-large */
135 |
136 | width: 1.5625em;
137 | }
138 | ul.icons {
139 | list-style-type: none;
140 | text-indent: -0.75em;
141 | }
142 | ul.icons li [class^="icon-"],
143 | ul.icons li [class*=" icon-"] {
144 | width: .75em;
145 | }
146 | .icon-muted {
147 | color: #eeeeee;
148 | }
149 | .icon-border {
150 | border: solid 1px #eeeeee;
151 | padding: .2em .25em .15em;
152 | -webkit-border-radius: 3px;
153 | -moz-border-radius: 3px;
154 | border-radius: 3px;
155 | }
156 | .icon-2x {
157 | font-size: 2em;
158 | }
159 | .icon-2x.icon-border {
160 | border-width: 2px;
161 | -webkit-border-radius: 4px;
162 | -moz-border-radius: 4px;
163 | border-radius: 4px;
164 | }
165 | .icon-3x {
166 | font-size: 3em;
167 | }
168 | .icon-3x.icon-border {
169 | border-width: 3px;
170 | -webkit-border-radius: 5px;
171 | -moz-border-radius: 5px;
172 | border-radius: 5px;
173 | }
174 | .icon-4x {
175 | font-size: 4em;
176 | }
177 | .icon-4x.icon-border {
178 | border-width: 4px;
179 | -webkit-border-radius: 6px;
180 | -moz-border-radius: 6px;
181 | border-radius: 6px;
182 | }
183 | .pull-right {
184 | float: right;
185 | }
186 | .pull-left {
187 | float: left;
188 | }
189 | [class^="icon-"].pull-left,
190 | [class*=" icon-"].pull-left {
191 | margin-right: .3em;
192 | }
193 | [class^="icon-"].pull-right,
194 | [class*=" icon-"].pull-right {
195 | margin-left: .3em;
196 | }
197 | .btn [class^="icon-"].pull-left.icon-2x,
198 | .btn [class*=" icon-"].pull-left.icon-2x,
199 | .btn [class^="icon-"].pull-right.icon-2x,
200 | .btn [class*=" icon-"].pull-right.icon-2x {
201 | margin-top: .18em;
202 | }
203 | .btn [class^="icon-"].icon-spin.icon-large,
204 | .btn [class*=" icon-"].icon-spin.icon-large {
205 | line-height: .8em;
206 | }
207 | .btn.btn-small [class^="icon-"].pull-left.icon-2x,
208 | .btn.btn-small [class*=" icon-"].pull-left.icon-2x,
209 | .btn.btn-small [class^="icon-"].pull-right.icon-2x,
210 | .btn.btn-small [class*=" icon-"].pull-right.icon-2x {
211 | margin-top: .25em;
212 | }
213 | .btn.btn-large [class^="icon-"],
214 | .btn.btn-large [class*=" icon-"] {
215 | margin-top: 0;
216 | }
217 | .btn.btn-large [class^="icon-"].pull-left.icon-2x,
218 | .btn.btn-large [class*=" icon-"].pull-left.icon-2x,
219 | .btn.btn-large [class^="icon-"].pull-right.icon-2x,
220 | .btn.btn-large [class*=" icon-"].pull-right.icon-2x {
221 | margin-top: .05em;
222 | }
223 | .btn.btn-large [class^="icon-"].pull-left.icon-2x,
224 | .btn.btn-large [class*=" icon-"].pull-left.icon-2x {
225 | margin-right: .2em;
226 | }
227 | .btn.btn-large [class^="icon-"].pull-right.icon-2x,
228 | .btn.btn-large [class*=" icon-"].pull-right.icon-2x {
229 | margin-left: .2em;
230 | }
231 | .icon-spin {
232 | display: inline-block;
233 | -moz-animation: spin 2s infinite linear;
234 | -o-animation: spin 2s infinite linear;
235 | -webkit-animation: spin 2s infinite linear;
236 | animation: spin 2s infinite linear;
237 | }
238 | @-moz-keyframes spin {
239 | 0% { -moz-transform: rotate(0deg); }
240 | 100% { -moz-transform: rotate(359deg); }
241 | }
242 | @-webkit-keyframes spin {
243 | 0% { -webkit-transform: rotate(0deg); }
244 | 100% { -webkit-transform: rotate(359deg); }
245 | }
246 | @-o-keyframes spin {
247 | 0% { -o-transform: rotate(0deg); }
248 | 100% { -o-transform: rotate(359deg); }
249 | }
250 | @-ms-keyframes spin {
251 | 0% { -ms-transform: rotate(0deg); }
252 | 100% { -ms-transform: rotate(359deg); }
253 | }
254 | @keyframes spin {
255 | 0% { transform: rotate(0deg); }
256 | 100% { transform: rotate(359deg); }
257 | }
258 | @-moz-document url-prefix() {
259 | .icon-spin {
260 | height: .9em;
261 | }
262 | .btn .icon-spin {
263 | height: auto;
264 | }
265 | .icon-spin.icon-large {
266 | height: 1.25em;
267 | }
268 | .btn .icon-spin.icon-large {
269 | height: .75em;
270 | }
271 | }.icon-remove:before { content: "\f021"; }
272 | .icon-play-circle:before { content: "\f022"; }
273 | .icon-repeat:before { content: "\f023"; }
274 | .icon-volume-off:before { content: "\f024"; }
275 | .icon-volume-down:before { content: "\f025"; }
276 | .icon-volume-up:before { content: "\f026"; }
277 | .icon-share:before { content: "\f027"; }
278 | .icon-check:before { content: "\f028"; }
279 | .icon-play:before { content: "\f029"; }
280 | .icon-pause:before { content: "\f02a"; }
281 | .icon-resize-full:before { content: "\f02b"; }
282 | .icon-resize-small:before { content: "\f02c"; }
283 | .icon-spinner:before { content: "\f02d"; }
284 |
--------------------------------------------------------------------------------
/demo/font-style/fonts/fontawesome.less:
--------------------------------------------------------------------------------
1 | /*!
2 | * Font Awesome 3.0.2
3 | * the iconic font designed for use with Twitter Bootstrap
4 | * -------------------------------------------------------
5 | * The full suite of pictographic icons, examples, and documentation
6 | * can be found at: http://fortawesome.github.com/Font-Awesome/
7 | *
8 | * License
9 | * -------------------------------------------------------
10 | * - The Font Awesome font is licensed under the SIL Open Font License - http://scripts.sil.org/OFL
11 | * - Font Awesome CSS, LESS, and SASS files are licensed under the MIT License -
12 | * http://opensource.org/licenses/mit-license.html
13 | * - The Font Awesome pictograms are licensed under the CC BY 3.0 License - http://creativecommons.org/licenses/by/3.0/
14 | * - Attribution is no longer required in Font Awesome 3.0, but much appreciated:
15 | * "Font Awesome by Dave Gandy - http://fortawesome.github.com/Font-Awesome"
16 |
17 | * Contact
18 | * -------------------------------------------------------
19 | * Email: dave@davegandy.com
20 | * Twitter: http://twitter.com/fortaweso_me
21 | * Work: Lead Product Designer @ http://kyruus.com
22 | */
23 |
24 | @FontAwesomePath: "";
25 | @borderColor: #eee;
26 | @iconMuted: #eee;
27 | .border-radius(@radius) { -webkit-border-radius: @radius; -moz-border-radius: @radius; border-radius: @radius; }
28 |
29 | @font-face {
30 | font-family: 'FontAwesome';
31 | src: url('@{FontAwesomePath}/fontawesome-webfont.eot?v=3.0.1');
32 | src: url('@{FontAwesomePath}/fontawesome-webfont.eot?#iefix&v=3.0.1') format('embedded-opentype'),
33 | url('@{FontAwesomePath}/fontawesome-webfont.woff?v=3.0.1') format('woff'),
34 | url('@{FontAwesomePath}/fontawesome-webfont.ttf?v=3.0.1') format('truetype');
35 | // url('@{FontAwesomePath}/fontawesome-webfont.svg#fontawesomeregular?v=3.0.1') format('svg');
36 |
37 | // src: url('@{FontAwesomePath}/FontAwesome.otf') format('opentype');
38 |
39 | font-weight: normal;
40 | font-style: normal;
41 | }
42 |
43 | /* Font Awesome styles
44 | ------------------------------------------------------- */
45 | [class^="icon-"],
46 | [class*=" icon-"] {
47 | font-family: FontAwesome;
48 | font-weight: normal;
49 | font-style: normal;
50 | text-decoration: inherit;
51 | -webkit-font-smoothing: antialiased;
52 |
53 | /* sprites.less reset */
54 | display: inline;
55 | width: auto;
56 | height: auto;
57 | line-height: normal;
58 | vertical-align: baseline;
59 | background-image: none;
60 | background-position: 0% 0%;
61 | background-repeat: repeat;
62 | margin-top: 0;
63 | }
64 |
65 | /* more sprites.less reset */
66 | .icon-white,
67 | .nav-pills > .active > a > [class^="icon-"],
68 | .nav-pills > .active > a > [class*=" icon-"],
69 | .nav-list > .active > a > [class^="icon-"],
70 | .nav-list > .active > a > [class*=" icon-"],
71 | .navbar-inverse .nav > .active > a > [class^="icon-"],
72 | .navbar-inverse .nav > .active > a > [class*=" icon-"],
73 | .dropdown-menu > li > a:hover > [class^="icon-"],
74 | .dropdown-menu > li > a:hover > [class*=" icon-"],
75 | .dropdown-menu > .active > a > [class^="icon-"],
76 | .dropdown-menu > .active > a > [class*=" icon-"],
77 | .dropdown-submenu:hover > a > [class^="icon-"],
78 | .dropdown-submenu:hover > a > [class*=" icon-"] {
79 | background-image: none;
80 | }
81 |
82 | [class^="icon-"]:before,
83 | [class*=" icon-"]:before {
84 | text-decoration: inherit;
85 | display: inline-block;
86 | speak: none;
87 | }
88 |
89 | /* makes sure icons active on rollover in links */
90 | a {
91 | [class^="icon-"],
92 | [class*=" icon-"] {
93 | display: inline-block;
94 | }
95 | }
96 |
97 | /* makes the font 33% larger relative to the icon container */
98 | .icon-large:before {
99 | vertical-align: -10%;
100 | font-size: 4/3em;
101 | }
102 |
103 | .btn, .nav {
104 | [class^="icon-"],
105 | [class*=" icon-"] {
106 | display: inline;
107 | /* keeps button heights with and without icons the same */
108 | &.icon-large { line-height: .9em; }
109 | &.icon-spin { display: inline-block; }
110 | }
111 | }
112 |
113 | .nav-tabs, .nav-pills {
114 | [class^="icon-"],
115 | [class*=" icon-"] {
116 | /* keeps button heights with and without icons the same */
117 | &, &.icon-large { line-height: .9em; }
118 | }
119 | }
120 |
121 | li, .nav li {
122 | [class^="icon-"],
123 | [class*=" icon-"] {
124 | display: inline-block;
125 | width: 1.25em;
126 | text-align: center;
127 | &.icon-large {
128 | /* increased font size for icon-large */
129 | width: 1.25*1.25em;
130 | }
131 | }
132 | }
133 |
134 | ul.icons {
135 | list-style-type: none;
136 | text-indent: -.75em;
137 |
138 | li {
139 | [class^="icon-"],
140 | [class*=" icon-"] {
141 | width: .75em;
142 | }
143 | }
144 | }
145 |
146 | .icon-muted {
147 | color: @iconMuted;
148 | }
149 |
150 | // Icon Borders
151 | // -------------------------
152 |
153 | .icon-border {
154 | border: solid 1px @borderColor;
155 | padding: .2em .25em .15em;
156 | .border-radius(3px);
157 | }
158 |
159 | // Icon Sizes
160 | // -------------------------
161 |
162 | .icon-2x {
163 | font-size: 2em;
164 | &.icon-border {
165 | border-width: 2px;
166 | .border-radius(4px);
167 | }
168 | }
169 | .icon-3x {
170 | font-size: 3em;
171 | &.icon-border {
172 | border-width: 3px;
173 | .border-radius(5px);
174 | }
175 | }
176 | .icon-4x {
177 | font-size: 4em;
178 | &.icon-border {
179 | border-width: 4px;
180 | .border-radius(6px);
181 | }
182 | }
183 |
184 | // Floats
185 | // -------------------------
186 |
187 | // Quick floats
188 | .pull-right { float: right; }
189 | .pull-left { float: left; }
190 |
191 | [class^="icon-"],
192 | [class*=" icon-"] {
193 | &.pull-left {
194 | margin-right: .3em;
195 | }
196 | &.pull-right {
197 | margin-left: .3em;
198 | }
199 | }
200 |
201 | .btn {
202 | [class^="icon-"],
203 | [class*=" icon-"] {
204 | &.pull-left, &.pull-right {
205 | &.icon-2x { margin-top: .18em; }
206 | }
207 | &.icon-spin.icon-large { line-height: .8em; }
208 | }
209 | }
210 |
211 | .btn.btn-small {
212 | [class^="icon-"],
213 | [class*=" icon-"] {
214 | &.pull-left, &.pull-right {
215 | &.icon-2x { margin-top: .25em; }
216 | }
217 | }
218 | }
219 |
220 | .btn.btn-large {
221 | [class^="icon-"],
222 | [class*=" icon-"] {
223 | margin-top: 0; // overrides bootstrap default
224 | &.pull-left, &.pull-right {
225 | &.icon-2x { margin-top: .05em; }
226 | }
227 | &.pull-left.icon-2x { margin-right: .2em; }
228 | &.pull-right.icon-2x { margin-left: .2em; }
229 | }
230 | }
231 |
232 |
233 | .icon-spin {
234 | display: inline-block;
235 | -moz-animation: spin 2s infinite linear;
236 | -o-animation: spin 2s infinite linear;
237 | -webkit-animation: spin 2s infinite linear;
238 | animation: spin 2s infinite linear;
239 | }
240 |
241 | @-moz-keyframes spin {
242 | 0% { -moz-transform: rotate(0deg); }
243 | 100% { -moz-transform: rotate(359deg); }
244 | }
245 | @-webkit-keyframes spin {
246 | 0% { -webkit-transform: rotate(0deg); }
247 | 100% { -webkit-transform: rotate(359deg); }
248 | }
249 | @-o-keyframes spin {
250 | 0% { -o-transform: rotate(0deg); }
251 | 100% { -o-transform: rotate(359deg); }
252 | }
253 | @-ms-keyframes spin {
254 | 0% { -ms-transform: rotate(0deg); }
255 | 100% { -ms-transform: rotate(359deg); }
256 | }
257 | @keyframes spin {
258 | 0% { transform: rotate(0deg); }
259 | 100% { transform: rotate(359deg); }
260 | }
261 |
262 | @-moz-document url-prefix() {
263 | .icon-spin { height: .9em; }
264 | .btn .icon-spin { height: auto; }
265 | .icon-spin.icon-large { height: 1.25em; }
266 | .btn .icon-spin.icon-large { height: .75em; }
267 | }
268 |
269 | /* Font Awesome uses the Unicode Private Use Area (PUA) to ensure screen
270 | readers do not read off random characters that represent icons */.icon-remove:before { content: "\f021"; }
271 | .icon-play-circle:before { content: "\f022"; }
272 | .icon-repeat:before { content: "\f023"; }
273 | .icon-volume-off:before { content: "\f024"; }
274 | .icon-volume-down:before { content: "\f025"; }
275 | .icon-volume-up:before { content: "\f026"; }
276 | .icon-share:before { content: "\f027"; }
277 | .icon-check:before { content: "\f028"; }
278 | .icon-play:before { content: "\f029"; }
279 | .icon-pause:before { content: "\f02a"; }
280 | .icon-resize-full:before { content: "\f02b"; }
281 | .icon-resize-small:before { content: "\f02c"; }
282 | .icon-spinner:before { content: "\f02d"; }
283 |
--------------------------------------------------------------------------------
/demo/font-style/fonts/fontawesome.sass:
--------------------------------------------------------------------------------
1 | /*!
2 | * Font Awesome 3.0.2
3 | * the iconic font designed for use with Twitter Bootstrap
4 | * -------------------------------------------------------
5 | * The full suite of pictographic icons, examples, and documentation
6 | * can be found at: http://fortawesome.github.com/Font-Awesome/
7 | *
8 | * License
9 | * -------------------------------------------------------
10 | * - The Font Awesome font is licensed under the SIL Open Font License - http://scripts.sil.org/OFL
11 | * - Font Awesome CSS, LESS, and SASS files are licensed under the MIT License -
12 | * http://opensource.org/licenses/mit-license.html
13 | * - The Font Awesome pictograms are licensed under the CC BY 3.0 License - http://creativecommons.org/licenses/by/3.0/
14 | * - Attribution is no longer required in Font Awesome 3.0, but much appreciated:
15 | * "Font Awesome by Dave Gandy - http://fortawesome.github.com/Font-Awesome"
16 | *
17 | * Contact
18 | * -------------------------------------------------------
19 | * Email: dave@davegandy.com
20 | * Twitter: http://twitter.com/fortaweso_me
21 | * Work: Lead Product Designer @ http://kyruus.com
22 | */
23 |
24 | $fontAwesomePath: "" !default
25 | $borderColor: #eee
26 | $iconMuted: #eee
27 | @mixin border-radius($radius)
28 | -webkit-border-radius: $radius
29 | -moz-border-radius: $radius
30 | border-radius: $radius
31 |
32 |
33 | @font-face
34 | font-family: 'FontAwesome'
35 | src: url('#{$fontAwesomePath}/fontawesome-webfont.eot?v=3.0.1')
36 | src: url('#{$fontAwesomePath}/fontawesome-webfont.eot?#iefix&v=3.0.1') format("embedded-opentype"), url('#{$fontAwesomePath}/fontawesome-webfont.woff?v=3.0.1') format("woff"), url('#{$fontAwesomePath}/fontawesome-webfont.ttf?v=3.0.1') format("truetype")
37 | font-weight: normal
38 | font-style: normal
39 |
40 |
41 | /* Font Awesome styles
42 | * -------------------------------------------------------
43 |
44 | [class^="icon-"],
45 | [class*=" icon-"]
46 | font-family: FontAwesome
47 | font-weight: normal
48 | font-style: normal
49 | text-decoration: inherit
50 | -webkit-font-smoothing: antialiased
51 |
52 | /* sprites.less reset */
53 | display: inline
54 | width: auto
55 | height: auto
56 | line-height: normal
57 | vertical-align: baseline
58 | background-image: none
59 | background-position: 0% 0%
60 | background-repeat: repeat
61 | margin-top: 0
62 |
63 | /* more sprites.less reset */
64 | .icon-white,
65 | .nav-pills > .active > a > [class^="icon-"],
66 | .nav-pills > .active > a > [class*=" icon-"],
67 | .nav-list > .active > a > [class^="icon-"],
68 | .nav-list > .active > a > [class*=" icon-"],
69 | .navbar-inverse .nav > .active > a > [class^="icon-"],
70 | .navbar-inverse .nav > .active > a > [class*=" icon-"],
71 | .dropdown-menu > li > a:hover > [class^="icon-"],
72 | .dropdown-menu > li > a:hover > [class*=" icon-"],
73 | .dropdown-menu > .active > a > [class^="icon-"],
74 | .dropdown-menu > .active > a > [class*=" icon-"],
75 | .dropdown-submenu:hover > a > [class^="icon-"],
76 | .dropdown-submenu:hover > a > [class*=" icon-"]
77 | background-image: none
78 |
79 | [class^="icon-"]:before,
80 | [class*=" icon-"]:before
81 | text-decoration: inherit
82 | display: inline-block
83 | speak: none
84 |
85 | /* makes sure icons active on rollover in links */
86 | a
87 | [class^="icon-"],
88 | [class*=" icon-"]
89 | display: inline-block
90 |
91 | /* makes the font 33% larger relative to the icon container */
92 | .icon-large:before
93 | vertical-align: -10%
94 | font-size: 1.3333333333333333em
95 |
96 | .btn, .nav
97 | [class^="icon-"],
98 | [class*=" icon-"]
99 | display: inline
100 | /* keeps button heights with and without icons the same */
101 | &.icon-large
102 | line-height: .9em
103 | &.icon-spin
104 | display: inline-block
105 |
106 | .nav-tabs, .nav-pills
107 | [class^="icon-"],
108 | [class*=" icon-"]
109 | /* keeps button heights with and without icons the same */
110 | line-height: .9em
111 | &.icon-large
112 | line-height: .9em
113 |
114 | li, .nav li
115 | [class^="icon-"],
116 | [class*=" icon-"]
117 | display: inline-block
118 | width: 1.25em
119 | text-align: center
120 | &.icon-large
121 | /* increased font size for icon-large */
122 | width: 1.5625em
123 |
124 | ul.icons
125 | list-style-type: none
126 | text-indent: -.75em
127 | li
128 | [class^="icon-"],
129 | [class*=" icon-"]
130 | width: .75em
131 |
132 | .icon-muted
133 | color: $iconMuted
134 |
135 | // Icon Borders
136 | // -------------------------
137 |
138 | .icon-border
139 | border: solid 1px $borderColor
140 | padding: .2em .25em .15em
141 | @include border-radius(3px)
142 |
143 | // Icon Sizes
144 | // -------------------------
145 |
146 | .icon-2x
147 | font-size: 2em
148 | &.icon-border
149 | border-width: 2px
150 | @include border-radius(4px)
151 |
152 | .icon-3x
153 | font-size: 3em
154 | &.icon-border
155 | border-width: 3px
156 | @include border-radius(5px)
157 |
158 | .icon-4x
159 | font-size: 4em
160 | &.icon-border
161 | border-width: 4px
162 | @include border-radius(6px)
163 |
164 | // Floats
165 | // -------------------------
166 |
167 | // Quick floats
168 | .pull-right
169 | float: right
170 | .pull-left
171 | float: left
172 |
173 | [class^="icon-"],
174 | [class*=" icon-"]
175 | &.pull-left
176 | margin-right: .3em
177 | &.pull-right
178 | margin-left: .3em
179 |
180 | .btn
181 | [class^="icon-"],
182 | [class*=" icon-"]
183 | &.pull-left, &.pull-right
184 | &.icon-2x
185 | margin-top: .18em
186 | &.icon-spin.icon-large
187 | line-height: .8em
188 |
189 | .btn.btn-small
190 | [class^="icon-"],
191 | [class*=" icon-"]
192 | &.pull-left, &.pull-right
193 | &.icon-2x
194 | margin-top: .25em
195 |
196 | .btn.btn-large
197 | [class^="icon-"],
198 | [class*=" icon-"]
199 | margin-top: 0 // overrides bootstrap default
200 | &.pull-left, &.pull-right
201 | &.icon-2x
202 | margin-top: .05em
203 | &.pull-left.icon-2x
204 | margin-right: .2em
205 | &.pull-right.icon-2x
206 | margin-left: .2em
207 |
208 |
209 | .icon-spin
210 | display: inline-block
211 | -moz-animation: spin 2s infinite linear
212 | -o-animation: spin 2s infinite linear
213 | -webkit-animation: spin 2s infinite linear
214 | animation: spin 2s infinite linear
215 |
216 | @-moz-keyframes spin
217 | 0%
218 | -moz-transform: rotate(0deg)
219 | 100%
220 | -moz-transform: rotate(359deg)
221 |
222 | @-webkit-keyframes spin
223 | 0%
224 | -webkit-transform: rotate(0deg)
225 | 100%
226 | -webkit-transform: rotate(359deg)
227 |
228 | @-o-keyframes spin
229 | 0%
230 | -o-transform: rotate(0deg)
231 | 100%
232 | -o-transform: rotate(359deg)
233 |
234 | @-ms-keyframes spin
235 | 0%
236 | -ms-transform: rotate(0deg)
237 | 100%
238 | -ms-transform: rotate(359deg)
239 |
240 | @keyframes spin
241 | 0%
242 | transform: rotate(0deg)
243 | 100%
244 | transform: rotate(359deg)
245 |
246 | @-moz-document url-prefix()
247 | .icon-spin
248 | height: .9em
249 | .btn .icon-spin
250 | height: auto
251 | .icon-spin.icon-large
252 | height: 1.25em
253 | .btn .icon-spin.icon-large
254 | height: .75em
255 |
256 | .icon-remove:before
257 | content: "\f021"
258 |
259 | .icon-play-circle:before
260 | content: "\f022"
261 |
262 | .icon-repeat:before
263 | content: "\f023"
264 |
265 | .icon-volume-off:before
266 | content: "\f024"
267 |
268 | .icon-volume-down:before
269 | content: "\f025"
270 |
271 | .icon-volume-up:before
272 | content: "\f026"
273 |
274 | .icon-share:before
275 | content: "\f027"
276 |
277 | .icon-check:before
278 | content: "\f028"
279 |
280 | .icon-play:before
281 | content: "\f029"
282 |
283 | .icon-pause:before
284 | content: "\f02a"
285 |
286 | .icon-resize-full:before
287 | content: "\f02b"
288 |
289 | .icon-resize-small:before
290 | content: "\f02c"
291 |
292 | .icon-spinner:before
293 | content: "\f02d"
294 |
295 |
--------------------------------------------------------------------------------
/demo/font-style/fonts/fontawesome.scss:
--------------------------------------------------------------------------------
1 | /*!
2 | * Font Awesome 3.0.2
3 | * the iconic font designed for use with Twitter Bootstrap
4 | * -------------------------------------------------------
5 | * The full suite of pictographic icons, examples, and documentation
6 | * can be found at: http://fortawesome.github.com/Font-Awesome/
7 | *
8 | * License
9 | * -------------------------------------------------------
10 | * - The Font Awesome font is licensed under the SIL Open Font License - http://scripts.sil.org/OFL
11 | * - Font Awesome CSS, LESS, and SASS files are licensed under the MIT License -
12 | * http://opensource.org/licenses/mit-license.html
13 | * - The Font Awesome pictograms are licensed under the CC BY 3.0 License - http://creativecommons.org/licenses/by/3.0/
14 | * - Attribution is no longer required in Font Awesome 3.0, but much appreciated:
15 | * "Font Awesome by Dave Gandy - http://fortawesome.github.com/Font-Awesome"
16 | *
17 | * Contact
18 | * -------------------------------------------------------
19 | * Email: dave@davegandy.com
20 | * Twitter: http://twitter.com/fortaweso_me
21 | * Work: Lead Product Designer @ http://kyruus.com
22 | */
23 |
24 | $fontAwesomePath: "" !default;
25 | $borderColor: #eee;
26 | $iconMuted: #eee;
27 | @mixin border-radius($radius) { -webkit-border-radius: $radius; -moz-border-radius: $radius; border-radius: $radius; }
28 |
29 |
30 | @font-face {
31 | font-family: 'FontAwesome';
32 | src: url('#{$fontAwesomePath}/fontawesome-webfont.eot?v=3.0.1');
33 | src: url('#{$fontAwesomePath}/fontawesome-webfont.eot?#iefix&v=3.0.1') format("embedded-opentype"),
34 | url('#{$fontAwesomePath}/fontawesome-webfont.woff?v=3.0.1') format("woff"),
35 | url('#{$fontAwesomePath}/fontawesome-webfont.ttf?v=3.0.1') format("truetype");
36 | font-weight: normal;
37 | font-style: normal;
38 | }
39 |
40 | /* Font Awesome styles
41 | ------------------------------------------------------- */
42 | [class^="icon-"],
43 | [class*=" icon-"] {
44 | font-family: FontAwesome;
45 | font-weight: normal;
46 | font-style: normal;
47 | text-decoration: inherit;
48 | -webkit-font-smoothing: antialiased;
49 |
50 | /* sprites.less reset */
51 | display: inline;
52 | width: auto;
53 | height: auto;
54 | line-height: normal;
55 | vertical-align: baseline;
56 | background-image: none;
57 | background-position: 0% 0%;
58 | background-repeat: repeat;
59 | margin-top: 0;
60 | }
61 |
62 | /* more sprites.less reset */
63 | .icon-white,
64 | .nav-pills > .active > a > [class^="icon-"],
65 | .nav-pills > .active > a > [class*=" icon-"],
66 | .nav-list > .active > a > [class^="icon-"],
67 | .nav-list > .active > a > [class*=" icon-"],
68 | .navbar-inverse .nav > .active > a > [class^="icon-"],
69 | .navbar-inverse .nav > .active > a > [class*=" icon-"],
70 | .dropdown-menu > li > a:hover > [class^="icon-"],
71 | .dropdown-menu > li > a:hover > [class*=" icon-"],
72 | .dropdown-menu > .active > a > [class^="icon-"],
73 | .dropdown-menu > .active > a > [class*=" icon-"],
74 | .dropdown-submenu:hover > a > [class^="icon-"],
75 | .dropdown-submenu:hover > a > [class*=" icon-"] {
76 | background-image: none;
77 | }
78 |
79 | [class^="icon-"]:before,
80 | [class*=" icon-"]:before {
81 | text-decoration: inherit;
82 | display: inline-block;
83 | speak: none;
84 | }
85 |
86 | /* makes sure icons active on rollover in links */
87 | a {
88 | [class^="icon-"],
89 | [class*=" icon-"] {
90 | display: inline-block;
91 | }
92 | }
93 |
94 | /* makes the font 33% larger relative to the icon container */
95 | .icon-large:before {
96 | vertical-align: -10%;
97 | font-size: 1.3333333333333333em;
98 | }
99 |
100 | .btn, .nav {
101 | [class^="icon-"],
102 | [class*=" icon-"] {
103 | display: inline;
104 | /* keeps button heights with and without icons the same */
105 | &.icon-large { line-height: .9em; }
106 | &.icon-spin { display: inline-block; }
107 | }
108 | }
109 |
110 | .nav-tabs, .nav-pills {
111 | [class^="icon-"],
112 | [class*=" icon-"] {
113 | /* keeps button heights with and without icons the same */
114 | &, &.icon-large { line-height: .9em; }
115 | }
116 | }
117 |
118 | li, .nav li {
119 | [class^="icon-"],
120 | [class*=" icon-"] {
121 | display: inline-block;
122 | width: 1.25em;
123 | text-align: center;
124 | &.icon-large {
125 | /* increased font size for icon-large */
126 | width: 1.5625em;
127 | }
128 | }
129 | }
130 |
131 | ul.icons {
132 | list-style-type: none;
133 | text-indent: -.75em;
134 |
135 | li {
136 | [class^="icon-"],
137 | [class*=" icon-"] {
138 | width: .75em;
139 | }
140 | }
141 | }
142 |
143 | .icon-muted {
144 | color: $iconMuted;
145 | }
146 |
147 | // Icon Borders
148 | // -------------------------
149 |
150 | .icon-border {
151 | border: solid 1px $borderColor;
152 | padding: .2em .25em .15em;
153 | @include border-radius(3px);
154 | }
155 |
156 | // Icon Sizes
157 | // -------------------------
158 |
159 | .icon-2x {
160 | font-size: 2em;
161 | &.icon-border {
162 | border-width: 2px;
163 | @include border-radius(4px);
164 | }
165 | }
166 | .icon-3x {
167 | font-size: 3em;
168 | &.icon-border {
169 | border-width: 3px;
170 | @include border-radius(5px);
171 | }
172 | }
173 | .icon-4x {
174 | font-size: 4em;
175 | &.icon-border {
176 | border-width: 4px;
177 | @include border-radius(6px);
178 | }
179 | }
180 |
181 | // Floats
182 | // -------------------------
183 |
184 | // Quick floats
185 | .pull-right { float: right; }
186 | .pull-left { float: left; }
187 |
188 | [class^="icon-"],
189 | [class*=" icon-"] {
190 | &.pull-left {
191 | margin-right: .3em;
192 | }
193 | &.pull-right {
194 | margin-left: .3em;
195 | }
196 | }
197 |
198 | .btn {
199 | [class^="icon-"],
200 | [class*=" icon-"] {
201 | &.pull-left, &.pull-right {
202 | &.icon-2x { margin-top: .18em; }
203 | }
204 | &.icon-spin.icon-large { line-height: .8em; }
205 | }
206 | }
207 |
208 | .btn.btn-small {
209 | [class^="icon-"],
210 | [class*=" icon-"] {
211 | &.pull-left, &.pull-right {
212 | &.icon-2x { margin-top: .25em; }
213 | }
214 | }
215 | }
216 |
217 | .btn.btn-large {
218 | [class^="icon-"],
219 | [class*=" icon-"] {
220 | margin-top: 0; // overrides bootstrap default
221 | &.pull-left, &.pull-right {
222 | &.icon-2x { margin-top: .05em; }
223 | }
224 | &.pull-left.icon-2x { margin-right: .2em; }
225 | &.pull-right.icon-2x { margin-left: .2em; }
226 | }
227 | }
228 |
229 |
230 | .icon-spin {
231 | display: inline-block;
232 | -moz-animation: spin 2s infinite linear;
233 | -o-animation: spin 2s infinite linear;
234 | -webkit-animation: spin 2s infinite linear;
235 | animation: spin 2s infinite linear;
236 | }
237 |
238 | @-moz-keyframes spin {
239 | 0% { -moz-transform: rotate(0deg); }
240 | 100% { -moz-transform: rotate(359deg); }
241 | }
242 | @-webkit-keyframes spin {
243 | 0% { -webkit-transform: rotate(0deg); }
244 | 100% { -webkit-transform: rotate(359deg); }
245 | }
246 | @-o-keyframes spin {
247 | 0% { -o-transform: rotate(0deg); }
248 | 100% { -o-transform: rotate(359deg); }
249 | }
250 | @-ms-keyframes spin {
251 | 0% { -ms-transform: rotate(0deg); }
252 | 100% { -ms-transform: rotate(359deg); }
253 | }
254 | @keyframes spin {
255 | 0% { transform: rotate(0deg); }
256 | 100% { transform: rotate(359deg); }
257 | }
258 |
259 | @-moz-document url-prefix() {
260 | .icon-spin { height: .9em; }
261 | .btn .icon-spin { height: auto; }
262 | .icon-spin.icon-large { height: 1.25em; }
263 | .btn .icon-spin.icon-large { height: .75em; }
264 | }.icon-remove:before { content: "\f021"; }
265 | .icon-play-circle:before { content: "\f022"; }
266 | .icon-repeat:before { content: "\f023"; }
267 | .icon-volume-off:before { content: "\f024"; }
268 | .icon-volume-down:before { content: "\f025"; }
269 | .icon-volume-up:before { content: "\f026"; }
270 | .icon-share:before { content: "\f027"; }
271 | .icon-check:before { content: "\f028"; }
272 | .icon-play:before { content: "\f029"; }
273 | .icon-pause:before { content: "\f02a"; }
274 | .icon-resize-full:before { content: "\f02b"; }
275 | .icon-resize-small:before { content: "\f02c"; }
276 | .icon-spinner:before { content: "\f02d"; }
277 |
--------------------------------------------------------------------------------
/demo/font-style/fonts/icon-reference.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | icnfnt generated subset of FontAwesome 3.0.2
6 |
7 |
25 |
28 |
29 |
30 |
31 | .icon-remove .icon-play-circle .icon-repeat .icon-volume-off .icon-volume-down .icon-volume-up .icon-share .icon-check .icon-play .icon-pause .icon-resize-full .icon-resize-small .icon-spinner
--------------------------------------------------------------------------------
/demo/font-style/img/loader.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aFarkas/jMediaelement/d6d7391ad9695eab92ae725747488099f4eb75b0/demo/font-style/img/loader.gif
--------------------------------------------------------------------------------
/demo/index-plugin-dev.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
27 |
28 |
29 |
38 | mediaplayer
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/demo/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
31 |
32 |
33 |
46 | jme2
47 |
48 |
49 |
50 |
51 |
52 |
JME is a declarative HTML component library including DOM APIs and CSS-hooks to extend/customize HTML5 mediaelements (audio/video)
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
74 |
75 |
76 |
77 |
mediaplayer
78 |
79 |
80 | jme element class
81 |
82 |
83 | mediaplayer
84 |
85 |
86 | prefered elements
87 |
88 |
89 | div
90 |
91 |
92 | jme pseudo classes
93 |
94 |
95 |
96 | media state classes
97 | state-idle
98 | state-waiting
99 | state-playing
100 | state-initial
101 | state-ended
102 | state-error
103 | user state classes
104 | focusenter
105 | useractive
106 | fover
107 | (:hover)
108 |
109 |
110 |
111 |
112 | jme content attributes
113 |
114 |
115 | controlbar
116 |
117 |
118 | controls
119 |
120 | jme interface
121 |
122 | {
123 | property boolean controlbar;
124 | property boolean fullscreen;
125 | readonly property jQuery media;
126 | jQuery addControls(controls);
127 | readonly property string embedUrl;
128 | jQuery getIframe([width, height]);
129 | };
130 |
131 |
132 |
133 |
The mediaplayer
element class wraps a mediaelement (audio/video) and associates this mediaelement with its control elements. The mediaplayer
element class serves also as an user interaction wrapper for the player.
134 |
135 |
Using jme pseudo classes to build the user interface.
136 |
137 |
138 | .mediaplayer .media-controls {
139 | transition: all 400ms ease 0s;
140 | }
141 | /* hide player controls, if mediaelement is playing,... */
142 | .mediaplayer.state-playing .media-controls {
143 | opacity: 0;
144 | }
145 | /* ...but show controls if user is moving his mouse */
146 | .mediaplayer.useractive .media-controls {
147 | opacity: 1;
148 | }
149 |
150 |
151 |
Using jme interface to switch to custom styleable controls:
152 |
153 |
154 | $('div.mediaplayer').jmeProp('controlbar', true);
155 |
156 |
157 |
Using jme interface to toggle fullscreen:
158 |
159 |
160 | $('div.mediaplayer').jmeProp('fullscreen', function(i, state){
161 | return !state;
162 | });
163 |
164 |
165 |
166 |
Dynamically add a new control to a mediaplayer:
167 |
168 |
169 | $('div.mediaplayer')
170 | .jmeFn('addControls', $('<button class="play-pause">play/pause</button>').prependTo('body') )
171 | ;
172 |
173 |
174 |
175 |
176 |
177 |
JME extensions for native audio/video element
178 |
179 |
180 | elements
181 |
182 |
183 | audio
184 |
185 |
186 | video
187 |
188 |
189 | jme interface
190 |
191 | {
192 | readonly property jQuery player;
193 | property mixed srces;
194 | readonly property boolean isPlaying;
195 | readonly property number progress;
196 | jQuery togglePlay();
197 | Rangearray concerningRange([type:string ("buffered"), time:string (currentTime)]);
198 | formatedTime formatTime(seconds:number[, format:Array]);
199 | };
200 |
201 |
202 |
203 |
204 |
205 |
play-pause button
206 |
207 |
208 | jme element class
209 |
210 |
211 | play-pause
212 |
213 |
214 | prefered elements
215 |
216 |
217 | button
218 |
219 |
220 | jme pseudo classes
221 |
222 |
223 | state-paused
, state-playing
224 |
225 | jme interface
226 |
227 | {
228 | readonly property jQuery player;
229 | readonly property jQuery media;
230 | };
231 |
232 |
233 |
234 | play / pause
235 |
236 |
237 |
238 |
mute-unmute button
239 |
240 |
241 | jme element class
242 |
243 |
244 | mute-unmute
245 |
246 |
247 | prefered elements
248 |
249 |
250 | button
251 |
252 |
253 | jme pseudo classes
254 |
255 |
256 | state-mute
, state-unmute
257 |
258 | jme interface
259 |
260 | {
261 | readonly property jQuery player;
262 | readonly property jQuery media;
263 | };
264 |
265 |
266 |
267 | mute /unmute
268 |
269 |
270 |
271 |
buffer-progress
272 |
273 |
274 | jme element class
275 |
276 |
277 | buffer-progress
278 |
279 |
280 | prefered elements
281 |
282 |
283 | div
284 |
285 |
286 | jme interface
287 |
288 | {
289 | readonly property jQuery player;
290 | readonly property jQuery media;
291 | readonly proptery Number progress;
292 | };
293 |
294 |
295 |
296 |
297 |
volume-slider
298 |
299 |
300 | jme element class
301 |
302 |
303 | volume-slider
304 |
305 |
306 | prefered elements
307 |
308 |
309 | div
310 |
311 |
312 | jme interface
313 |
314 | {
315 | readonly property jQuery player;
316 | readonly property jQuery media;
317 | };
318 |
319 |
320 |
321 |
322 |
time-slider
323 |
324 |
325 | jme element class
326 |
327 |
328 | time-slider
329 |
330 |
331 | prefered elements
332 |
333 |
334 | div
335 |
336 |
337 | jme content attributes
338 |
339 |
340 | format
341 |
342 | jme interface
343 |
344 | {
345 | readonly property jQuery player;
346 | readonly property jQuery media;
347 | property mixed format; //not implemented yet
348 | };
349 |
350 |
351 |
352 |
353 |
354 |
currenttime-display
355 |
356 |
357 | jme element class
358 |
359 |
360 | currenttime-display
361 |
362 |
363 | prefered elements
364 |
365 |
366 | div
367 |
368 |
369 | jme content attributes
370 |
371 |
372 | format
373 |
374 |
375 | countdown
376 |
377 | jme interface
378 |
379 | {
380 | readonly property jQuery player;
381 | readonly property jQuery media;
382 | property boolean countdown;
383 | property mixed format;
384 | };
385 |
386 |
387 |
388 |
389 |
390 |
391 |
392 |
393 |
394 |
duration-display
395 |
396 |
397 | jme element class
398 |
399 |
400 | currenttime-display
401 |
402 |
403 | prefered elements
404 |
405 |
406 | div
407 |
408 |
409 | jme content attributes
410 |
411 |
412 | format
413 |
414 | jme interface
415 |
416 | {
417 | readonly property jQuery player;
418 | readonly property jQuery media;
419 | property mixed format;
420 | };
421 |
422 |
423 |
424 |
425 |
426 |
427 |
428 |
intrinsic ratio responsive/fluid video
429 |
based on http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/
430 |
431 |
16:9 ratio
432 |
433 |
434 |
435 |
436 |
437 |
438 |
439 |
4:3 ratio
440 |
441 |
442 |
443 |
444 |
445 |
446 |
447 |
453 |
454 |
455 |
--------------------------------------------------------------------------------
/demo/jme-jqm.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | JME 2 + jQuery Mobile
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
31 |
32 |
33 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 | JME 2 + jQuery Mobile
63 | Back
64 | Home
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
123 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
160 |
161 |
162 |
163 |
164 |
--------------------------------------------------------------------------------
/demo/jqm-style/css/player-styles.css:
--------------------------------------------------------------------------------
1 | /*
2 | * HTML5 Boilerplate
3 | *
4 | * What follows is the result of much research on cross-browser styling.
5 | * Credit left inline and big thanks to Nicolas Gallagher, Jonathan Neal,
6 | * Kroc Camen, and the H5BP dev community and team.
7 | */
8 |
9 |
10 | /* =============================================================================
11 | HTML5 element display
12 | ========================================================================== */
13 |
14 | article, aside, details, figcaption, figure, footer, header, hgroup, nav, section { display: block; }
15 | audio[controls], canvas, video { display: inline-block; *display: inline; *zoom: 1; }
16 |
17 |
18 | /* =============================================================================
19 | Base
20 | ========================================================================== */
21 |
22 | /*
23 | * 1. Correct text resizing oddly in IE6/7 when body font-size is set using em units
24 | * http://clagnut.com/blog/348/#c790
25 | * 2. Force vertical scrollbar in non-IE
26 | * 3. Remove Android and iOS tap highlight color to prevent entire container being highlighted
27 | * www.yuiblog.com/blog/2010/10/01/quick-tip-customizing-the-mobile-safari-tap-highlight-color/
28 | * 4. Prevent iOS text size adjust on device orientation change, without disabling user zoom
29 | * www.456bereastreet.com/archive/201012/controlling_text_size_in_safari_for_ios_without_disabling_user_zoom/
30 | */
31 |
32 | html { font-size: 100%; overflow-y: scroll; -webkit-overflow-scrolling: touch; -webkit-tap-highlight-color: rgba(0,0,0,0); -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; }
33 |
34 | body { margin: 0; font-size: 13px; line-height: 1.231; }
35 |
36 | body, button, input, select, textarea { font-family: sans-serif; color: #222; }
37 |
38 | /*
39 | * These selection declarations have to be separate
40 | * No text-shadow: twitter.com/miketaylr/status/12228805301
41 | * Also: hot pink!
42 | */
43 |
44 | ::-moz-selection { background: #fe57a1; color: #fff; text-shadow: none; }
45 | ::selection { background: #fe57a1; color: #fff; text-shadow: none; }
46 |
47 |
48 | /* =============================================================================
49 | Links
50 | ========================================================================== */
51 |
52 | a { color: #00e; }
53 | a:visited { color: #551a8b; }
54 | a:focus { outline: thin dotted; }
55 |
56 | /* Improve readability when focused and hovered in all browsers: people.opera.com/patrickl/experiments/keyboard/test */
57 | a:hover, a:active { outline: 0; }
58 |
59 |
60 | /* =============================================================================
61 | Typography
62 | ========================================================================== */
63 |
64 | abbr[title] { border-bottom: 1px dotted; }
65 |
66 | b, strong { font-weight: bold; }
67 |
68 | blockquote { margin: 1em 40px; }
69 |
70 | dfn { font-style: italic; }
71 |
72 | hr { display: block; height: 1px; border: 0; border-top: 1px solid #ccc; margin: 1em 0; padding: 0; }
73 |
74 | ins { background: #ff9; color: #000; text-decoration: none; }
75 |
76 | mark { background: #ff0; color: #000; font-style: italic; font-weight: bold; }
77 |
78 | /* Redeclare monospace font family: en.wikipedia.org/wiki/User:Davidgothberg/Test59 */
79 | pre, code, kbd, samp { font-family: monospace, monospace; _font-family: 'courier new', monospace; font-size: 1em; }
80 |
81 | /* Improve readability of pre-formatted text in all browsers */
82 | pre { white-space: pre; white-space: pre-wrap; word-wrap: break-word; }
83 |
84 | q { quotes: none; }
85 | q:before, q:after { content: ""; content: none; }
86 |
87 | small { font-size: 85%; }
88 |
89 | /* Position subscript and superscript content without affecting line-height: gist.github.com/413930 */
90 | sub, sup { font-size: 75%; line-height: 0; position: relative; vertical-align: baseline; }
91 | sup { top: -0.5em; }
92 | sub { bottom: -0.25em; }
93 |
94 |
95 | /* =============================================================================
96 | Lists
97 | ========================================================================== */
98 |
99 | ul, ol { margin: 1em 0; padding: 0 0 0 40px; }
100 | dd { margin: 0 0 0 40px; }
101 | nav ul, nav ol { list-style: none; margin: 0; padding: 0; }
102 |
103 |
104 | /* =============================================================================
105 | Embedded content
106 | ========================================================================== */
107 |
108 | /*
109 | * Improve image quality when scaled in IE7
110 | * code.flickr.com/blog/2008/11/12/on-ui-quality-the-little-things-client-side-image-resizing/
111 | */
112 |
113 | img { border: 0; -ms-interpolation-mode: bicubic; }
114 |
115 | /*
116 | * Correct overflow displayed oddly in IE9
117 | */
118 |
119 | svg:not(:root) {
120 | overflow: hidden;
121 | }
122 |
123 |
124 | /* =============================================================================
125 | Figures
126 | ========================================================================== */
127 |
128 | figure { margin: 0; }
129 |
130 |
131 | /* =============================================================================
132 | Forms
133 | ========================================================================== */
134 |
135 | form { margin: 0; }
136 | fieldset { border: 0; margin: 0; padding: 0; }
137 |
138 | /*
139 | * 1. Correct color not inheriting in IE6/7/8/9
140 | * 2. Correct alignment displayed oddly in IE6/7
141 | */
142 |
143 | legend { border: 0; *margin-left: -7px; padding: 0; }
144 |
145 | /* Indicate that 'label' will shift focus to the associated form element */
146 | label { cursor: pointer; }
147 |
148 | /*
149 | * 1. Correct font-size not inheriting in all browsers
150 | * 2. Remove margins in FF3/4 S5 Chrome
151 | * 3. Define consistent vertical alignment display in all browsers
152 | */
153 |
154 | button, input, select, textarea { font-size: 100%; margin: 0; vertical-align: baseline; *vertical-align: middle; }
155 |
156 | /*
157 | * 1. Define line-height as normal to match FF3/4 (set using !important in the UA stylesheet)
158 | * 2. Correct inner spacing displayed oddly in IE6/7
159 | */
160 |
161 | button, input { line-height: normal; *overflow: visible; }
162 |
163 | /*
164 | * 1. Display hand cursor for clickable form elements
165 | * 2. Allow styling of clickable form elements in iOS
166 | */
167 |
168 | button, input[type="button"], input[type="reset"], input[type="submit"] { cursor: pointer; -webkit-appearance: button; }
169 |
170 | /*
171 | * Consistent box sizing and appearance
172 | */
173 |
174 | input[type="checkbox"], input[type="radio"] { box-sizing: border-box; }
175 | input[type="search"] { -moz-box-sizing: content-box; -webkit-box-sizing: content-box; box-sizing: content-box; }
176 |
177 | /*
178 | * Remove inner padding and border in FF3/4
179 | * www.sitepen.com/blog/2008/05/14/the-devils-in-the-details-fixing-dojos-toolbar-buttons/
180 | */
181 |
182 | button::-moz-focus-inner, input::-moz-focus-inner { border: 0; padding: 0; }
183 |
184 | /* Remove default vertical scrollbar in IE6/7/8/9 */
185 | textarea { overflow: auto; vertical-align: top; }
186 |
187 | /* Colors for form validity */
188 | input:valid, textarea:valid { }
189 | input:invalid, textarea:invalid { background-color: #f0dddd; }
190 |
191 |
192 | /* =============================================================================
193 | Tables
194 | ========================================================================== */
195 |
196 | table { border-collapse: collapse; border-spacing: 0; }
197 |
198 |
199 | /* =============================================================================
200 | Primary styles
201 | Author: mderting
202 | ========================================================================== */
203 |
204 |
205 | ul.menu { list-style: none; margin: 0; padding: 0; }
206 | .nav-utility ul { overflow: hidden; }
207 | .nav-utility li { float: left; }
208 |
209 | /* MEDIA ELEMENTS
210 | -------------------- */
211 | .hmedia { margin: 5px; }
212 | .hmedia .polyfill-video { width: 100% !important; height: 100% !important; }
213 | .hmedia .polyfill-video object { display: block; width: 100%; height: 100%; }
214 | .hmedia video { width: 100%; height: auto; }
215 | .hmedia footer { margin: 0 8px; }
216 | .hmedia footer h2 { font-size: 1em; }
217 | .hmedia footer p.description { margin: 0; }
218 | .hmedia .media-info dt { clear: both; float: left; width: 9em; }
219 | .hmedia .media-info dd { margin-left: 9.5em; }
220 | .hmedia audio { height: 30px; }
221 |
222 | .mediaplayer { overflow: hidden; position: relative; }
223 |
224 | /* Media State */
225 | .jme-default-media-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; cursor: pointer; background: url("../img/loader.gif") no-repeat -9999px -9999px; opacity: 0.7;
226 | }
227 | .state-playing .jme-default-media-overlay { /* display: none; */ }
228 | .state-waiting .jme-default-media-overlay { background-position: center; }
229 | .state-idle .jme-default-media-overlay,
230 | .state-ended .jme-default-media-overlay { background: url("../img/play-overlay.png") center no-repeat; }
231 |
232 | /* Control Bar */
233 | .jme-default-control-bar,
234 | .jme-minimal-control-bar { overflow: hidden; position: absolute; left: 0; bottom: 0; width: 100%; height: 3em; }
235 |
236 | .media-controls { height: 3em; max-width: 980px; margin: 0 auto; padding: 0; }
237 |
238 | /* State Transitions */
239 | .media-controls,
240 | .captions-display { -moz-transition: all 400ms; -webkit-transition: all 400ms; -ms-transition: all 400ms; -o-transition: all 400ms; transition: all 400ms; }
241 | .mediaplayer.state-playing .media-controls/*,
242 | .mediaplayer.state-idle .media-controls */ { -moz-transform: translate(0, 100%); -webkit-transform: translate(0, 100%); -ms-transform: translate(0, 100%); -o-transform: translate(0, 100%); transform: translate(0, 100%); opacity: 0; }
243 | .no-opacity .mediaplayer.state-playing .media-controls,
244 | .no-opacity .mediaplayer.state-idle .media-controls { display: none; }
245 | .mediaplayer.useractive .media-controls { -moz-transform: translate(0, 0); -webkit-transform: translate(0, 0); -ms-transform: translate(0, 0); -o-transform: translate(0, 0); transform: translate(0, 0); opacity: 1; }
246 | .no-opacity .mediaplayer.useractive .media-controls { display: block; }
247 | .mediaplayer.useractive .captions-display { margin-bottom: 3em; }
248 |
249 | .media-controls a.ui-slider-handle .ui-btn-inner { height: 0.5em; } /* TODO: Create improvement issue for jQuery Mobile so border-radius looks correct (i.e. not square across top). */
250 |
251 | /* Displays */
252 | .media-controls .currenttime-display,
253 | .media-controls .duration-display { margin: 0.9em 8px 0.9em 0; }
254 |
255 | /* Minimal Control Bar */
256 | .jme-minimal-control-bar .media-bar .fullscreen-toggle { float: right; }
257 | .jme-minimal-control-bar .media-controls .currenttime-display,
258 | .jme-minimal-control-bar .media-controls .duration-display,
259 | .jme-minimal-control-bar .media-controls .volume-slider,
260 | .jme-minimal-control-bar .media-controls .time-slider { display: none; } /* Don't display some controls to conserve space. */
261 | .player-fullscreen .jme-minimal-control-bar .media-controls .currenttime-display,
262 | .player-fullscreen .jme-minimal-control-bar .media-controls .duration-display,
263 | .player-fullscreen .jme-minimal-control-bar .media-controls .volume-slider,
264 | .player-fullscreen .jme-minimal-control-bar .media-controls .time-slider { display: block; } /* Display all controls when in fullscreen mode. */
265 |
266 | /* Additions for poster-display plugin.
267 | * NOTE: Rules to vertically center poster image inspired by Bruno Fassino.
268 | * @see http://www.brunildo.org/test/img_center.html
269 | */
270 | .poster-display { position: absolute; top: 0; left: 0; width: 100%; height: 100%; vertical-align: middle; display: none; }
271 | .opacity .poster-display {display: table-cell; opacity: 0; -moz-transition: all 900ms; -webkit-transition: all 900ms; -ms-transition: all 900ms; -o-transition: all 900ms; transition: all 900ms;}
272 | .state-ended .poster-display {display: block; display: table-cell; opacity: 1;}
273 | .poster-display * { vertical-align: middle; }
274 | .poster-display span { display: inline-block; height: 100%; }
275 | .poster-display .poster-image { width: 100%; height: 100%; }
276 | .player-fullscreen .poster-display .poster-image { display: inline-block; height: auto; }
277 |
278 | /* Additions for captions plugin */
279 | .captions-display { position: absolute; bottom: 0; z-index: 0; width: 100%; height: 100%; margin-bottom: 0; color: #fff; text-align: center; text-shadow: 0 1px 0 #000; } /* NOTE: Captionator adds inline styles to the generated div.captionator-cue-canvas, one of which is z-index: 100;. We need to set z-index: 0; here to force the Captionator generated elements to stack within this element, without effecting the stacking order of siblings of .captions-display. -mderting */
280 |
281 | /* Media Bar */
282 | .media-controls .media-bar { overflow: hidden; position: relative; height: 2em; min-height: 2em; margin: 0; padding: 0; }
283 | html > body .media-controls .media-bar { height: auto; background-color: transparent; }
284 | .media-controls .media-bar > * { float: left; }
285 |
286 |
287 | /* Volume Slider */
288 | .media-controls .volume-controls { overflow: hidden; display: inline-block; margin-right: 8px; zoom: 1; }
289 | .media-controls .volume-controls > * { float: left; }
290 | .media-controls .volume-slider { top: 0; width: 30px; height: 30px; margin: 3px; background: transparent url("../img/player-sprites.png") -460px 50% no-repeat; cursor: pointer; }
291 | .media-controls .volume-slider .ui-slider-range { top: 0; left: 0; height: 100%; min-width: 1px; min-height: 1px; background: transparent url("../img/player-sprites.png") -420px 50% no-repeat; }
292 | .media-controls .volume-slider .ui-slider-handle { width: 1px; height: 100%; margin-left: 0; background: none; } /* Overrides JQM a.ui-slider-handle { width: 28px; height: 28px; margin-left: -15px; } */
293 | .media-controls .volume-slider .ui-slider-handle.ui-state-focus,
294 | .media-controls .volume-slider .ui-slider-handle.ui-state-active { outline: thin dotted; }
295 |
296 |
297 | /* Timeline Slider */
298 | .media-controls .time-slider { margin: 0.7em 15px 0 20px; border-radius: .6em; } /* Inherits rules from JQM div.ui-slider. Overrides div.ui-slider { margin: 0 2% 0 20px; } */
299 | .media-controls .ui-slider-disabled { background: #111; }
300 | .media-controls .time-slider .ui-slider-handle {
301 | z-index: 9;
302 | outline: medium none;
303 | border: 1px solid #222;
304 | color: #fff;
305 | font-weight: bold;
306 | text-shadow: 0 -1px 1px #000;
307 | background: #333333;
308 | background-image: -webkit-gradient(linear, left top, left bottom, from(#555), to(#333)); /* Saf4+, Chrome */
309 | background-image: -webkit-linear-gradient(#555,#333); /* Chrome 10+, Saf5.1+ */
310 | background-image: -moz-linear-gradient(#555,#333 ); /* FF3.6 */
311 | background-image: -ms-linear-gradient(#555,#333 ); /* IE10 */
312 | background-image: -o-linear-gradient(#555,#333 ); /* Opera 11.10+ */
313 | background-image: linear-gradient(#555,#333 );
314 | }
315 | .media-controls .time-slider .ui-slider-handle.ui-state-focus,
316 | .media-controls .time-slider .ui-slider-handle.ui-state-active { -moz-box-shadow: 0px 0px 12px #387bbe; -webkit-box-shadow: 0px 0px 12px #387bbe; box-shadow: 0px 0px 12px #387bbe; } /* FIXME: Duplicates JQM rules defined for .ui-btn:focus, .ui-focus. Investigate why .ui-btn:focus isn't being applied. Once fixed, we should be able to remove these rules. -mderting */
317 | .media-controls .time-slider .ui-slider-range { position: absolute; top: 0; left: 0; height: 100%; border-radius: .6em; background: #e1e1e1; cursor: pointer; }
318 |
319 | /* Buffer Progress Bar */
320 | .media-controls .buffer-progress { height: 100%; min-width: 40px; }
321 | .media-controls .buffer-progress .buffer-progress-indicator { height: 100%; border-radius: .6em; background: rgba(51,102,153,0.8); cursor: pointer; }
322 |
323 | /* Fullscreen */
324 | html.has-media-fullscreen,
325 | body.has-media-fullscreen { overflow: hidden; }
326 | .player-fullscreen { position: fixed !important; z-index: 999999; background: #000; }
327 | .player-fullscreen,
328 | .media-fullscreen { top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important; width: 100% !important; height: 100% !important; margin: 0 !important; padding: 0 !important; }
329 | .media-fullscreen { position: relative; }
330 |
331 | /* Toggles */
332 | .toggle-controlgroup { margin: 0.2em 0 0.2em 8px; }
333 | .toggle-controlgroup,
334 | .toggle-controlgroup fieldset.ui-controlgroup { float: left; }
335 | .toggle-control { overflow: hidden; }
336 | .toggle-control fieldset.ui-controlgroup { margin: 0; } /* Overrides JQM fieldset.ui-controlgroup { margin: 0.5em 0 1em; } */
337 | .toggle-control .ui-checkbox label .ui-btn-inner { height: 1em; padding: .6em 0px; } /* Overrides JQM .ui-btn-inner { padding: .6em 25px; } */
338 | .toggle-control .ui-checkbox label .ui-btn-text { display: block; width: 44px; height:1em; }
339 | .toggle-control .ui-checkbox label .jme-icon { display: block; position: absolute;
340 | top: 50%; left: 10px; width: 24px; height: 24px; margin-top: -12px; }
341 | .toggle-control .ui-checkbox label .jme-text { position: absolute; left: -9999px; }
342 | .toggle-control span.ui-slider-label,
343 | .toggle-control .ui-checkbox label .jme-icon { background-image: url(../img/player-sprites.png); background-repeat: no-repeat; background-size: 537px 24px; -moz-background-size: 537px 24px; -o-background-size: 537px 24px; -webkit-background-size: 537px 24px; text-indent: -9999em; }
344 | /* play / pause */
345 | .toggle-control .ui-checkbox label.play-toggle.ui-checkbox-off .jme-icon { background-position: 0 50%; }
346 | .toggle-control .ui-checkbox label.play-toggle.ui-checkbox-on .jme-icon { background-position: -47px 50%; }
347 | /* captions on / captions off */
348 | .toggle-control .ui-checkbox label.captions-toggle.ui-checkbox-off .jme-icon { background-position: -140px 50%; }
349 | .toggle-control .ui-checkbox label.captions-toggle.ui-checkbox-on .jme-icon { background-position: -187px 50%; }
350 | /* mute / unmute */
351 | .toggle-control .ui-checkbox label.mute-toggle.ui-checkbox-off .jme-icon { background-position: -233px 50%; }
352 | .toggle-control .ui-checkbox label.mute-toggle.ui-checkbox-on .jme-icon { background-position: -280px 50%; }
353 |
354 | /* fullscreen */
355 | .fullscreen-toggle { width: 66px; margin-right: 8px; }
356 | .fullscreen-toggle span.ui-slider-label-a { background-position: -273px 50%; background-size: 403px 18px; -moz-background-size: 403px 18px; -o-background-size: 403px 18px; -webkit-background-size: 403px 18px; }
357 | .fullscreen-toggle span.ui-slider-label-b { background-position: -240px 50%; background-size: 403px 18px; -moz-background-size: 403px 18px; -o-background-size: 403px 18px; -webkit-background-size: 403px 18px; }
358 | .media-controls .fullscreen-toggle .ui-slider-handle { outline: medium none; }
359 | .media-controls .fullscreen-toggle .ui-slider-handle:focus,
360 | .media-controls .fullscreen-toggle .ui-slider-handle:active { -moz-box-shadow: 0px 0px 12px #387bbe; -webkit-box-shadow: 0px 0px 12px #387bbe; box-shadow: 0px 0px 12px #387bbe; } /* FIXME: Duplicates JQM rules defined for .ui-btn:focus, .ui-focus. Investigate why .ui-btn:focus isn't being applied. Once fixed, we should be able to remove these rules. -mderting */
361 |
362 |
363 |
364 |
365 | /* =============================================================================
366 | Non-semantic helper classes
367 | Please define your styles before this section.
368 | ========================================================================== */
369 |
370 | /* For image replacement */
371 | .ir { display: block; text-indent: -999em; overflow: hidden; background-repeat: no-repeat; text-align: left; direction: ltr; }
372 | .ir br { display: none; }
373 |
374 | /* Hide for both screenreaders and browsers:
375 | css-discuss.incutio.com/wiki/Screenreader_Visibility */
376 | .hidden { display: none; visibility: hidden; }
377 |
378 | /* Hide only visually, but have it available for screenreaders: by Jon Neal.
379 | www.webaim.org/techniques/css/invisiblecontent/ & j.mp/visuallyhidden */
380 | .visuallyhidden { border: 0; clip: rect(0 0 0 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; }
381 |
382 | /* Extends the .visuallyhidden class to allow the element to be focusable when navigated to via the keyboard: drupal.org/node/897638 */
383 | .visuallyhidden.focusable:active, .visuallyhidden.focusable:focus { clip: auto; height: auto; margin: 0; overflow: visible; position: static; width: auto; }
384 |
385 | /* Hide visually and from screenreaders, but maintain layout */
386 | .invisible { visibility: hidden; }
387 |
388 | /* Contain floats: nicolasgallagher.com/micro-clearfix-hack/ */
389 | .clearfix:before, .clearfix:after { content: ""; display: table; }
390 | .clearfix:after { clear: both; }
391 | .clearfix { zoom: 1; }
392 |
393 |
394 |
395 | /* =============================================================================
396 | PLACEHOLDER Media Queries for Responsive Design.
397 | These override the primary ('mobile first') styles
398 | Modify as content requires.
399 | ========================================================================== */
400 |
401 | @media only screen and (min-width: 480px) {
402 | /* Style adjustments for viewports 480px and over go here */
403 |
404 | }
405 |
406 | @media only screen and (min-width: 768px) {
407 | /* Style adjustments for viewports 768px and over go here */
408 | #wrapper.ui-body-c { background: #040404; } /* Overrides JQM */
409 | }
410 |
411 | @media only screen and (min-width: 980px) {
412 | /* Style adjustments for viewports 980px and over go here */
413 |
414 | #wrapper-2 { width: 940px; margin: 0 auto; border: 2px solid #636363; }
415 | .mediaplayer { width: 930px; height: 523px; }
416 | }
417 |
418 |
419 | /* =============================================================================
420 | Print styles.
421 | Inlined to avoid required HTTP connection: www.phpied.com/delay-loading-your-print-css/
422 | ========================================================================== */
423 |
424 | @media print {
425 | * { background: transparent !important; color: black !important; text-shadow: none !important; filter:none !important; -ms-filter: none !important; } /* Black prints faster: sanbeiji.com/archives/953 */
426 | a, a:visited { color: #444 !important; text-decoration: underline; }
427 | a[href]:after { content: " (" attr(href) ")"; }
428 | abbr[title]:after { content: " (" attr(title) ")"; }
429 | .ir a:after, a[href^="javascript:"]:after, a[href^="#"]:after { content: ""; } /* Don't show links for images, or javascript/internal links */
430 | pre, blockquote { border: 1px solid #999; page-break-inside: avoid; }
431 | thead { display: table-header-group; } /* css-discuss.incutio.com/wiki/Printing_Tables */
432 | tr, img { page-break-inside: avoid; }
433 | img { max-width: 100% !important; }
434 | @page { margin: 0.5cm; }
435 | p, h2, h3 { orphans: 3; widows: 3; }
436 | h2, h3{ page-break-after: avoid; }
437 | }
438 |
--------------------------------------------------------------------------------
/demo/jqm-style/img/loader.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aFarkas/jMediaelement/d6d7391ad9695eab92ae725747488099f4eb75b0/demo/jqm-style/img/loader.gif
--------------------------------------------------------------------------------
/demo/jqm-style/img/play-overlay.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aFarkas/jMediaelement/d6d7391ad9695eab92ae725747488099f4eb75b0/demo/jqm-style/img/play-overlay.png
--------------------------------------------------------------------------------
/demo/jqm-style/img/player-sprites.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aFarkas/jMediaelement/d6d7391ad9695eab92ae725747488099f4eb75b0/demo/jqm-style/img/player-sprites.png
--------------------------------------------------------------------------------
/demo/js/jme.base.min.js:
--------------------------------------------------------------------------------
1 | !function(a){window.webshims||(a.webshims=a.webshims||{ready:function(a,b){b()},addReady:function(b){a(function(){b(document,a([]))})}},window.webshims=a.webshims);var b=a.webshims;window.Modernizr&&"opacity"in Modernizr||a("html").addClass("opacity"in document.documentElement.style?"opacity":"no-opacity");var c={},d={},e=!1;a(window).on("load",function(){e=!0;var b,c=function(){e=!0};a(window).on("scroll",function(){e=!1,clearTimeout(b),b=setTimeout(c,999)})}),a.jme={version:"2.0.9",classNS:"",options:{},plugins:{},data:function(b,c,d){var e=a(b).data(h+"jme")||a.data(b,h+"jme",{});return void 0===d?c?e[c]:e:void(e[c]=d)},registerPlugin:function(a,b){this.plugins[a]=b,b.nodeName||(b.nodeName=""),b.className||(b.className=a)},defineMethod:function(a,b){d[a]=b},defineProp:function(b,d){d||(d={}),d.set||(d.set=d.readonly?function(){throw b+" is readonly"}:a.noop),d.get||(d.get=function(c){return a.jme.data(c,b)}),c[b]=d},prop:function(b,d,e){if(!c[d])return a.prop(b,d,e);if(void 0===e)return c[d].get(b);var f=c[d].set(b,e);void 0===f&&(f=e),"noDataSet"!=f&&a.jme.data(b,d,f)},setText:function(b,c){var d=b;b&&c&&(d={},d[b]=c),a.each(d,function(b,c){a.jme.plugins[b]&&(a.jme.plugins[b].text=c)})}},a.fn.jmeProp=function(b,c){return a.access(this,a.jme.prop,b,c,arguments.length>1)},a.fn.jmeFn=function(b){var c,e=Array.prototype.slice.call(arguments,1);return this.each(function(){return c=(d[b]||a.prop(this,b)).apply(this,e),void 0!==c?!1:void 0}),void 0!==c?c:this};var f,g=[],h="";a.jme.createSelectors=function(){f||(h=a.jme.classNS,f="div."+h+"mediaplayer",a.each(a.jme.plugins,function(b,c){c.className=h+c.className,c.selector=c.nodeName+"."+c.className,g.push(c.selector),h&&c.pseudoClasses&&a.each(c.pseudoClasses,function(a,b){c.pseudoClasses[a]=h+b})}),g=g.join(","))},a.jme.initJME=function(b,c){a("video, audio",b).add(c.filter("video, audio")).filter("[data-muted]").each(function(){a.prop(this,"muted",!0)}).end().filter("[data-volume]").each(function(){var b=a(this).data("volume");1>=b&&b>=0&&a.prop(this,"volume",b)}),a(f,b).add(c.filter(f)).jmePlayer()};var i={emptied:1,pause:1};a.jme.getDOMList=function(b){var c=[];return b||(b=[]),"string"==typeof b&&(b=b.split(" ")),a.each(b,function(a,b){b&&(b=document.getElementById(b),b&&c.push(b))}),c},b.ready("dom-support",function(){b.defineNodeNamesProperty&&!a(" ").prop("labels")&&b.defineNodeNamesProperty("button, input, keygen, meter, output, progress, select, textarea","labels",{prop:{get:function(){var b=[],c=this.id;return c&&(b=a('label[for="'+c+'"]')),b[0]||(b=a(this).closest("label",this.form)),b.get()},writeable:!1}})}),a.jme.getButtonText=function(b,c){var d=a("span.jme-text, +label span.jme-text",b),e=b.prop("labels");e=e&&e[0]?a(e).eq(0):!1,d[0]||(d=e||b);var f,g,h,i,j=d.text().split("/"),k=b.prop("title").split("/"),l=function(k){i!==k&&(i=k,g&&d.text(j[k||0]),h&&(b.prop("title",j[k||0]),e&&e.prop("title",j[k||0])),c&&b.removeClass(c[k?0:1]).addClass(c[k]),f&&(b.prop("checked",!!k),(b.data("checkboxradio")||{refresh:a.noop}).refresh()))};return 2==j.length&&(j[0]=j[0].trim(),j[1]=j[1].trim(),g=!0),2==k.length&&(k[0]=k[0].trim(),k[1]=k[1].trim(),h=!0),b.is('[type="checkbox"], [type="radio"]')?(b.prop("checked",function(){return this.defaultChecked}),f=!0):b.is("a")&&b.bind("click",function(a){a.preventDefault()}),l},a.fn.jmePlayer=function(b){var c=["idle","playing","ended","waiting","mediaerror"].map(function(a){return h+"state-"+a}).join(" ");return this.each(function(){b&&a.jme.data(this,a.extend(!0,{},b));var d,f,j,k,l,m,n,o,p=a("audio, video",this).filter(":first"),q=a(this),r=a(g,q),s=a.jme.getDOMList(a.jme.data(this,"controls")),t=r.add(a(s)),u=a.jme.data(this),v=a.jme.data(p[0]);q.addClass(p.prop("nodeName").toLowerCase()+"player"),v.player=q,v.media=p,u.media||(f=!0,o=!p.prop("autoplay"),m=function(){p.unbind("canplay",l),clearTimeout(n)},l=function(){var b=a.prop(this,"paused")?"idle":"playing";q.removeClass(c).addClass(h+"state-"+b)},d=function(b){var d,e,f=b.type;m(),"ended"==f||a.prop(this,"ended")?f="ended":"waiting"==f?a.prop(this,"readyState")>2?f="":(n=setTimeout(function(){p.prop("readyState")>2&&l()},9),p.bind("canPlay",l)):i[f]?f="idle":(d=a.prop(this,"readyState"),e=a.prop(this,"paused"),f=!e&&3>d?"waiting":!e&&d>2?"playing":"idle"),f&&q.removeClass(c).addClass(h+"state-"+f)},u.media=p,u.player=q,p.bind("ended",function(){m(),p.jmeFn("pause"),p.prop("autoplay")||p.prop("loop")||p.hasClass("no-reload")||p.jmeFn("load")}).bind("emptied waiting canplay canplaythrough playing ended pause mediaerror",d).bind("volumechange updateJMEState",function(){var b=a.prop(this,"volume");q[!b||a.prop(this,"muted")?"addClass":"removeClass"](h+"state-muted"),b=.34>b?"low":.67>b?"medium":"high",q.attr("data-volume",b)}).bind("emptied updateJMEState play playing waiting",function(b){var c;"emptied"==b.type||"updateJMEState"==b.type&&a.prop(this,"paused")?("emptied"==b.type&&(o=!p.prop("autoplay")),c="addClass"):("play"==b.type||"waiting"==b.type||"playing"==b.type)&&(c="removeClass"),c&&q[c](h+"state-initial")}),q.addClass(h+"userinactive").on({useractive:function(){q.addClass(h+"useractive").removeClass(h+"userinactive")},focusin:function(){clearTimeout(j),q.addClass(h+"focusenter")},focusout:function(){clearTimeout(j),j=setTimeout(function(){q.removeClass(h+"focusenter")},1)},"mouseenter focusin":function(){clearTimeout(k),q.addClass(h+"fover"),o&&e&&(p.prop("preload","auto"),o=!1)},"mouseleave focusout":function(){clearTimeout(k),k=setTimeout(function(){q.removeClass(h+"fover")},1)}}).on("userinactive",{idletime:3500},function(){q.removeClass(h+"useractive").addClass(h+"userinactive")})),q.jmeFn("addControls",t),f&&(u.controlbar&&q.jmeProp("controlbar",!0),d&&p.bind("updateJMEState",d).triggerHandler("updateJMEState"))})},a.jme.defineProp("isPlaying",{get:function(b){return!a.prop(b,"ended")&&!a.prop(b,"paused")&&a.prop(b,"readyState")>1&&!a.data(b,"mediaerror")},readonly:!0}),a.jme.defineProp("player",{readonly:!0}),a.jme.defineProp("media",{readonly:!0}),a.jme.defineProp("srces",{get:function(b){var c=a.jme.data(b),d=c.media.prop("src"),e=[];return d?[{src:d}]:e=a.map(a("source",c.media).get(),function(b){var c={src:a.prop(b,"src")},d=a.attr(b,"media");return d&&(c.media=d),d=a.attr(b,"type"),d&&(c.type=d),c})},set:function(b,c){var d=a.jme.data(b),e=function(b,c){"string"==typeof c&&(c={src:c}),a(document.createElement("source")).attr(c).appendTo(d.media)};return d.media.removeAttr("src").find("source").remove(),a.isArray(c)?a.each(c,e):e(0,c),d.media.jmeFn("load"),"noDataSet"}}),a.jme.defineMethod("togglePlay",function(){a(this).jmeFn(c.isPlaying.get(this)?"pause":"play")}),a.jme.defineProp("controlbar",{set:function(b,c){c=!!c;var d,e=a.jme.data(b),f=a("div.jme-default-media-overlay, div.jme-default-control-bar",e.player),g=a.jme.plugins["media-controls"],i="";return c&&!f[0]?e._controlbar?e._controlbar.appendTo(e.player):(e.media.prop("controls",!1),a.each(g.pluginOrder,function(b,c){var d=a.jme.plugins[c];d&&d.structure?i+=d.structure.replace("{%class%}",h+c).replace("{%text%}",d.text||""):c&&(i+=c)}),e._controlbar=a(g.barStructure),f=e._controlbar.find("div.jme-cb-box").addClass(h+"media-controls"),d=e._controlbar.filter(".jme-default-media-overlay").addClass(h+"play-pause"),d=d.add(f),d=d.add(a(i).appendTo(f)),e._controlbar.appendTo(e.player),e.player.jmeFn("addControls",d)):c||f.detach(),f=null,d=null,c}}),a.jme.defineMethod("addControls",function(b){var c=a.jme.data(this)||{};if(c.media){var d=a.jme.data(c.player[0],"controlElements")||a([]);b=a(b),a.each(a.jme.plugins,function(d,e){b.filter("."+e.className).add(b.find("."+e.className)).each(function(){var b=a(this),d=a.jme.data(this);d.player=c.player,d.media=c.media,d.rendered||(d.rendered=!0,e.options&&a.each(e.options,function(a,b){a in d||(d[a]=b)}),e._create(b,c.media,c.player,d),b=null)})}),a.jme.data(c.player[0],"controlElements",d.add(b)),c.player.triggerHandler("controlsadded")}}),a.jme.defineMethod("updateControlbar",function(){var b=a("."+a.jme.classNS+"time-slider",this);if(b[0]&&"absolute"!==b.css("position")){var c,d=0,e={position:b[0].style.position,display:b[0].style.display};b.css({display:"none",position:"absolute"}),c=Math.floor(b.parent().width())-.2,b.siblings().each(function(){this!==b[0]&&"absolute"!==a.css(this,"position")&&"none"!==a.css(this,"display")&&(d+=Math.ceil(a(this).outerWidth(!0))+.1)}).end().css(e),b.width(Math.floor(c-d-Math.ceil(b.outerWidth(!0)-b.width())-.3))}}),a.jme.registerPlugin("media-controls",{pluginOrder:["play-pause",'"],barStructure:'
',_create:function(b,c,d){var e,f=function(){clearTimeout(e),b.jmeFn("updateControlbar"),e=setTimeout(function(){b.jmeFn("updateControlbar")},9)};setTimeout(function(){c.bind("loadedmetadata volumechange play pause ended emptied",f),d.bind("updatetimeformat controlsadded controlschanged playerdimensionchange",f),a(window).bind("resize emchange",f)},1),f()}}),function(){var b={add:function(b,c,d){var e,f,g=a.data(b,"jmeuseractivity")||a.data(b,"jmeuseractivity",{idletime:2500,idle:!0,trigger:{}}),h=a(b),i=function(){g.idle||(g.idle=!0,g.trigger.userinactive&&h.trigger("userinactive"))},j=function(a){!a||"mousemove"===a.type&&a.pageX===e&&a.pageY===f||("mousemove"===a.type&&(e=a.pageX,f=a.pageY),g.idleTimer&&clearTimeout(g.idleTimer),g.idleTimer=setTimeout(i,g.idletime),g.idle&&(g.idle=!1,g.trigger.useractive&&h.trigger("useractive")))};g.idletime=(c||{}).idletime||g.idletime,c&&"idle"in c&&(g.idle=c.idle),g.trigger[d]=!0,g.bound||(h.bind("mouseleave.jmeuseractivity",i).bind("mousemove.jmeuseractivity focusin.jmeuseractivity mouseenter.jmeuseractivity keydown.jmeuseractivity keyup.jmeuseractivity mousedown.jmeuseractivity",j),g.bound=!0),g.idle||j({type:"initunidled"})},remove:function(b,c){var d=a.data(b,"jmeuseractivity")||a.data(b,"jmeuseractivity",{idletime:2500,idle:!0,trigger:{}});d.trigger[c]=!1,d.trigger.useractive||d.trigger.userinactive||(a(b).unbind(".jmeuseractivity"),d.bound=!1)}};a.each(["useractive","userinactive"],function(c,d){a.event.special[d]={setup:function(a){b.add(this,a,d)},teardown:function(){b.remove(this,d)}}})}()}(jQuery),function(a){function b(a,b){var c,d,e;return{get:function(){return e?void 0:a.apply(this,arguments)},set:function(){clearTimeout(c),clearTimeout(d);var a=this,f=arguments;e=!0,c=setTimeout(function(){b.apply(a,f),d=setTimeout(function(){e=!1},30)},0)}}}var c="pseudoClasses",d={play:1,playing:1},e={pause:1,ended:1},f=(!(Modernizr.boxSizing||Modernizr["display-table"]||Modernizr.video||a.support.getSetAttribute),function(){a.webshims.loader&&a.webshims.loader.loadList(["range-ui"])}),g=function(b){f(),a.webshims.ready("range-ui",b)},h='{%text%} ',i='
',j='
';a.jme.registerPlugin("play-pause",{pseudoClasses:{play:"state-paused",pause:"state-playing"},structure:h,text:"play / pause",_create:function(b,f){var g=a.jme.getButtonText(b,[this[c].play,this[c].pause]);f.bind("play playing ended pause updateJMEState",function(a){var b=a.type;b=d[b]?1:e[b]?0:f.jmeProp("isPlaying")?1:0,g(b)}).triggerHandler("updateJMEState"),b.bind(b.is("select")?"change":"click",function(a){f.jmeFn("togglePlay"),a.stopPropagation()})}}),a.jme.registerPlugin("mute-unmute",{pseudoClasses:{mute:"state-mute",unmute:"state-unmute"},structure:h,text:"mute / unmute",_create:function(b,d){var e=a.jme.getButtonText(b,[this[c].mute,this[c].unmute]);d.bind("volumechange updateJMEState",function(){e(d.prop("muted")?1:0)}).triggerHandler("updateJMEState"),b.bind(b.is("select")?"change":"click",function(a){d.prop("muted",!d.prop("muted")),a.stopPropagation()})}}),a.jme.registerPlugin("volume-slider",{structure:j,_create:function(a,c){f();var d=function(){var d,e;e=b(function(){var a=c.prop("volume");void 0!==a&&d.value(a)},function(){c.prop({muted:!1,volume:d.options.value})}),d=a.rangeUI({min:0,max:1,step:"any",input:function(){e.set()}}).data("rangeUi"),c.bind("volumechange",e.get)};g(d)}}),a.jme.registerPlugin("time-slider",{structure:j,pseudoClasses:{no:"no-duration"},options:{format:["mm","ss"]},_create:function(d,e,h){f();var i=this,j=function(){var f,g,j,k,l=a.jme.classNS+"has-duration",m=(a.jme.classNS+"no-duration",e.prop("duration"));f=b(function(){var a=e.prop("currentTime");if(!isNaN(a))try{j.value(a)}catch(b){}},function(){try{e.prop("currentTime",j.options.value).triggerHandler("timechanged",[j.options.value])}catch(a){}}),g=function(){m=e.prop("duration"),l=m&&isFinite(m)&&!isNaN(m),l?(j.disabled(!1),j.max(m),h.removeClass(i[c].no)):(j.disabled(!0),j.max(Number.MAX_VALUE),h.addClass(i[c].no))},j=d.rangeUI({min:0,value:e.prop("currentTime")||0,step:"any",input:function(){f.set()},textValue:function(a){return e.jmeFn("formatTime",a)}}).data("rangeUi"),k=a(' ').appendTo(d),d.on({mouseenter:function(b){if(l){var c=(d.offset()||{left:0}).left,f=d.innerWidth(),g=function(a){var b=(a-c)/f*100;k.html(e.jmeFn("formatTime",m*b/100)).css({left:b+"%"})};g(b.pageX),k.addClass(a.jme.classNS+"show-time-select"),d.off(".jmetimeselect").on("mousemove.jmetimeselect",function(a){g(a.pageX)})}},mouseleave:function(){k.removeClass(a.jme.classNS+"show-time-select"),d.off(".jmetimeselect")}}),e.bind({timeupdate:f.get,emptied:function(){g(),j.value(0)},durationchange:g}),h.jmeFn("addControls",a('
').prependTo(d)),g()};g(j)}}),a.jme.defineMethod("concerningRange",function(b,c){var d=this,e={start:0,end:0};if(b||(b="buffered"),b=a.prop(d,b),null==c&&(c=a.prop(d,"currentTime")),!(b&&"length"in b))return e;for(var f=0,g=b.length;g>f&&(e.start=b.start(f),e.end=b.end(f),!(e.start<=c&&e.end>=c));f++);return e}),a.jme.defineProp("progress",{get:function(b){var c=a.jme.data(b);if(!c.media)return 0;var d=c.media.jmeFn("concerningRange").end/c.media.prop("duration")*100;return d>99.4&&(d=100),d||0},readonly:!0}),a.jme.registerPlugin("buffer-progress",{_create:function(b,c,d,e){var f=a('
').appendTo(b),g=function(){var a=c.jmeProp("progress");e.progress!==a&&(e.progress=a,f.css("width",a+"%"))};c.bind({progress:g,emptied:function(){f.css("width",0),e.progress=0},playing:g}),g()}});var k={hh:6e4,mm:60,ss:1,ms:.001},l=function(b,c){var d;c||(c=["mm","ss"]),null==b&&(d=a.jme.data(this),b=a.prop(d.media,"duration")),b||(b=0);for(var e,f=[],g=0,h=c.length;h>g;g++)"ms"==c[g]&&g==h-1?e=Math.round(b/k[c[g]]/10):(e=parseInt(b/k[c[g]],10),b%=k[c[g]]),10>e&&(e="0"+e),f.push(e);return f.join(":")};a.jme.defineMethod("formatTime",l),a.jme.defineProp("format",{set:function(b,c){a.isArray(c)||(c=c.split(":"));var d=a.jme.data(b);return d.format=c,a(b).triggerHandler("updatetimeformat"),d.player.triggerHandler("updatetimeformat"),"noDataSet"}}),a.jme.registerPlugin("duration-display",{structure:i,options:{format:"mm:ss"},_create:function(a,b,c,d){"string"==typeof d.format&&(d.format=d.format.split(":"));var e=function(){a.html(l(b.prop("duration"),d.format))};b.bind("durationchange emptied",e),a.bind("updatetimeformat",e).jmeProp("format",d.format)}}),a.jme.defineProp("countdown",{set:function(b,c){var d=a.jme.data(b);return d.countdown=!!c,a(b).triggerHandler("updatetimeformat"),d.player.triggerHandler("updatetimeformat"),"noDataSet"}}),a.jme.registerPlugin("currenttime-display",{structure:i,options:{format:"mm:ss",countdown:!1},_create:function(a,b,c,d){"string"==typeof d.format&&(d.format=d.format.split(":"));var e=function(){var c=b.prop("currentTime");d.countdown&&(c=(b.prop("duration")||0)-c,.7>c&&(c=0)),a.html(l(c,d.format))};b.bind("timeupdate emptied durationchange",e),a.bind("updatetimeformat",e).jmeProp("format",d.format)}}),a.jme.registerPlugin("poster-display",{structure:"
",options:{},_create:function(b,c){var d=function(){var d=c.prop("poster");d?b.html(' '):b.empty()};c.bind("emptied",d),d()}})}(jQuery),function(a){var b;a.jme.startJME=function(){if(!b){a.webshims.loader&&setTimeout(function(){a.webshims.loader.loadList(["range-ui"])},0),a(function(){a.jme.createSelectors(),a.jme.initJME(document,a([]))}),a.webshims.ready("mediaelement",function(){a.webshims.addReady(function(b,c){b!==document&&a.jme.initJME(b,c)})}),b=!0}},a(window).trigger("jmepluginready")}(window.webshims&&webshims.$||jQuery);
--------------------------------------------------------------------------------
/demo/js/jme.full.min.js:
--------------------------------------------------------------------------------
1 | !function(a){window.webshims||(a.webshims=a.webshims||{ready:function(a,b){b()},addReady:function(b){a(function(){b(document,a([]))})}},window.webshims=a.webshims);var b=a.webshims;window.Modernizr&&"opacity"in Modernizr||a("html").addClass("opacity"in document.documentElement.style?"opacity":"no-opacity");var c={},d={},e=!1;a(window).on("load",function(){e=!0;var b,c=function(){e=!0};a(window).on("scroll",function(){e=!1,clearTimeout(b),b=setTimeout(c,999)})}),a.jme={version:"2.0.9",classNS:"",options:{},plugins:{},data:function(b,c,d){var e=a(b).data(h+"jme")||a.data(b,h+"jme",{});return void 0===d?c?e[c]:e:void(e[c]=d)},registerPlugin:function(a,b){this.plugins[a]=b,b.nodeName||(b.nodeName=""),b.className||(b.className=a)},defineMethod:function(a,b){d[a]=b},defineProp:function(b,d){d||(d={}),d.set||(d.set=d.readonly?function(){throw b+" is readonly"}:a.noop),d.get||(d.get=function(c){return a.jme.data(c,b)}),c[b]=d},prop:function(b,d,e){if(!c[d])return a.prop(b,d,e);if(void 0===e)return c[d].get(b);var f=c[d].set(b,e);void 0===f&&(f=e),"noDataSet"!=f&&a.jme.data(b,d,f)},setText:function(b,c){var d=b;b&&c&&(d={},d[b]=c),a.each(d,function(b,c){a.jme.plugins[b]&&(a.jme.plugins[b].text=c)})}},a.fn.jmeProp=function(b,c){return a.access(this,a.jme.prop,b,c,arguments.length>1)},a.fn.jmeFn=function(b){var c,e=Array.prototype.slice.call(arguments,1);return this.each(function(){return c=(d[b]||a.prop(this,b)).apply(this,e),void 0!==c?!1:void 0}),void 0!==c?c:this};var f,g=[],h="";a.jme.createSelectors=function(){f||(h=a.jme.classNS,f="div."+h+"mediaplayer",a.each(a.jme.plugins,function(b,c){c.className=h+c.className,c.selector=c.nodeName+"."+c.className,g.push(c.selector),h&&c.pseudoClasses&&a.each(c.pseudoClasses,function(a,b){c.pseudoClasses[a]=h+b})}),g=g.join(","))},a.jme.initJME=function(b,c){a("video, audio",b).add(c.filter("video, audio")).filter("[data-muted]").each(function(){a.prop(this,"muted",!0)}).end().filter("[data-volume]").each(function(){var b=a(this).data("volume");1>=b&&b>=0&&a.prop(this,"volume",b)}),a(f,b).add(c.filter(f)).jmePlayer()};var i={emptied:1,pause:1};a.jme.getDOMList=function(b){var c=[];return b||(b=[]),"string"==typeof b&&(b=b.split(" ")),a.each(b,function(a,b){b&&(b=document.getElementById(b),b&&c.push(b))}),c},b.ready("dom-support",function(){b.defineNodeNamesProperty&&!a(" ").prop("labels")&&b.defineNodeNamesProperty("button, input, keygen, meter, output, progress, select, textarea","labels",{prop:{get:function(){var b=[],c=this.id;return c&&(b=a('label[for="'+c+'"]')),b[0]||(b=a(this).closest("label",this.form)),b.get()},writeable:!1}})}),a.jme.getButtonText=function(b,c){var d=a("span.jme-text, +label span.jme-text",b),e=b.prop("labels");e=e&&e[0]?a(e).eq(0):!1,d[0]||(d=e||b);var f,g,h,i,j=d.text().split("/"),k=b.prop("title").split("/"),l=function(k){i!==k&&(i=k,g&&d.text(j[k||0]),h&&(b.prop("title",j[k||0]),e&&e.prop("title",j[k||0])),c&&b.removeClass(c[k?0:1]).addClass(c[k]),f&&(b.prop("checked",!!k),(b.data("checkboxradio")||{refresh:a.noop}).refresh()))};return 2==j.length&&(j[0]=j[0].trim(),j[1]=j[1].trim(),g=!0),2==k.length&&(k[0]=k[0].trim(),k[1]=k[1].trim(),h=!0),b.is('[type="checkbox"], [type="radio"]')?(b.prop("checked",function(){return this.defaultChecked}),f=!0):b.is("a")&&b.bind("click",function(a){a.preventDefault()}),l},a.fn.jmePlayer=function(b){var c=["idle","playing","ended","waiting","mediaerror"].map(function(a){return h+"state-"+a}).join(" ");return this.each(function(){b&&a.jme.data(this,a.extend(!0,{},b));var d,f,j,k,l,m,n,o,p=a("audio, video",this).filter(":first"),q=a(this),r=a(g,q),s=a.jme.getDOMList(a.jme.data(this,"controls")),t=r.add(a(s)),u=a.jme.data(this),v=a.jme.data(p[0]);q.addClass(p.prop("nodeName").toLowerCase()+"player"),v.player=q,v.media=p,u.media||(f=!0,o=!p.prop("autoplay"),m=function(){p.unbind("canplay",l),clearTimeout(n)},l=function(){var b=a.prop(this,"paused")?"idle":"playing";q.removeClass(c).addClass(h+"state-"+b)},d=function(b){var d,e,f=b.type;m(),"ended"==f||a.prop(this,"ended")?f="ended":"waiting"==f?a.prop(this,"readyState")>2?f="":(n=setTimeout(function(){p.prop("readyState")>2&&l()},9),p.bind("canPlay",l)):i[f]?f="idle":(d=a.prop(this,"readyState"),e=a.prop(this,"paused"),f=!e&&3>d?"waiting":!e&&d>2?"playing":"idle"),f&&q.removeClass(c).addClass(h+"state-"+f)},u.media=p,u.player=q,p.bind("ended",function(){m(),p.jmeFn("pause"),p.prop("autoplay")||p.prop("loop")||p.hasClass("no-reload")||p.jmeFn("load")}).bind("emptied waiting canplay canplaythrough playing ended pause mediaerror",d).bind("volumechange updateJMEState",function(){var b=a.prop(this,"volume");q[!b||a.prop(this,"muted")?"addClass":"removeClass"](h+"state-muted"),b=.34>b?"low":.67>b?"medium":"high",q.attr("data-volume",b)}).bind("emptied updateJMEState play playing waiting",function(b){var c;"emptied"==b.type||"updateJMEState"==b.type&&a.prop(this,"paused")?("emptied"==b.type&&(o=!p.prop("autoplay")),c="addClass"):("play"==b.type||"waiting"==b.type||"playing"==b.type)&&(c="removeClass"),c&&q[c](h+"state-initial")}),q.addClass(h+"userinactive").on({useractive:function(){q.addClass(h+"useractive").removeClass(h+"userinactive")},focusin:function(){clearTimeout(j),q.addClass(h+"focusenter")},focusout:function(){clearTimeout(j),j=setTimeout(function(){q.removeClass(h+"focusenter")},1)},"mouseenter focusin":function(){clearTimeout(k),q.addClass(h+"fover"),o&&e&&(p.prop("preload","auto"),o=!1)},"mouseleave focusout":function(){clearTimeout(k),k=setTimeout(function(){q.removeClass(h+"fover")},1)}}).on("userinactive",{idletime:3500},function(){q.removeClass(h+"useractive").addClass(h+"userinactive")})),q.jmeFn("addControls",t),f&&(u.controlbar&&q.jmeProp("controlbar",!0),d&&p.bind("updateJMEState",d).triggerHandler("updateJMEState"))})},a.jme.defineProp("isPlaying",{get:function(b){return!a.prop(b,"ended")&&!a.prop(b,"paused")&&a.prop(b,"readyState")>1&&!a.data(b,"mediaerror")},readonly:!0}),a.jme.defineProp("player",{readonly:!0}),a.jme.defineProp("media",{readonly:!0}),a.jme.defineProp("srces",{get:function(b){var c=a.jme.data(b),d=c.media.prop("src"),e=[];return d?[{src:d}]:e=a.map(a("source",c.media).get(),function(b){var c={src:a.prop(b,"src")},d=a.attr(b,"media");return d&&(c.media=d),d=a.attr(b,"type"),d&&(c.type=d),c})},set:function(b,c){var d=a.jme.data(b),e=function(b,c){"string"==typeof c&&(c={src:c}),a(document.createElement("source")).attr(c).appendTo(d.media)};return d.media.removeAttr("src").find("source").remove(),a.isArray(c)?a.each(c,e):e(0,c),d.media.jmeFn("load"),"noDataSet"}}),a.jme.defineMethod("togglePlay",function(){a(this).jmeFn(c.isPlaying.get(this)?"pause":"play")}),a.jme.defineProp("controlbar",{set:function(b,c){c=!!c;var d,e=a.jme.data(b),f=a("div.jme-default-media-overlay, div.jme-default-control-bar",e.player),g=a.jme.plugins["media-controls"],i="";return c&&!f[0]?e._controlbar?e._controlbar.appendTo(e.player):(e.media.prop("controls",!1),a.each(g.pluginOrder,function(b,c){var d=a.jme.plugins[c];d&&d.structure?i+=d.structure.replace("{%class%}",h+c).replace("{%text%}",d.text||""):c&&(i+=c)}),e._controlbar=a(g.barStructure),f=e._controlbar.find("div.jme-cb-box").addClass(h+"media-controls"),d=e._controlbar.filter(".jme-default-media-overlay").addClass(h+"play-pause"),d=d.add(f),d=d.add(a(i).appendTo(f)),e._controlbar.appendTo(e.player),e.player.jmeFn("addControls",d)):c||f.detach(),f=null,d=null,c}}),a.jme.defineMethod("addControls",function(b){var c=a.jme.data(this)||{};if(c.media){var d=a.jme.data(c.player[0],"controlElements")||a([]);b=a(b),a.each(a.jme.plugins,function(d,e){b.filter("."+e.className).add(b.find("."+e.className)).each(function(){var b=a(this),d=a.jme.data(this);d.player=c.player,d.media=c.media,d.rendered||(d.rendered=!0,e.options&&a.each(e.options,function(a,b){a in d||(d[a]=b)}),e._create(b,c.media,c.player,d),b=null)})}),a.jme.data(c.player[0],"controlElements",d.add(b)),c.player.triggerHandler("controlsadded")}}),a.jme.defineMethod("updateControlbar",function(){var b=a("."+a.jme.classNS+"time-slider",this);if(b[0]&&"absolute"!==b.css("position")){var c,d=0,e={position:b[0].style.position,display:b[0].style.display};b.css({display:"none",position:"absolute"}),c=Math.floor(b.parent().width())-.2,b.siblings().each(function(){this!==b[0]&&"absolute"!==a.css(this,"position")&&"none"!==a.css(this,"display")&&(d+=Math.ceil(a(this).outerWidth(!0))+.1)}).end().css(e),b.width(Math.floor(c-d-Math.ceil(b.outerWidth(!0)-b.width())-.3))}}),a.jme.registerPlugin("media-controls",{pluginOrder:["play-pause",'"],barStructure:'
',_create:function(b,c,d){var e,f=function(){clearTimeout(e),b.jmeFn("updateControlbar"),e=setTimeout(function(){b.jmeFn("updateControlbar")},9)};setTimeout(function(){c.bind("loadedmetadata volumechange play pause ended emptied",f),d.bind("updatetimeformat controlsadded controlschanged playerdimensionchange",f),a(window).bind("resize emchange",f)},1),f()}}),function(){var b={add:function(b,c,d){var e,f,g=a.data(b,"jmeuseractivity")||a.data(b,"jmeuseractivity",{idletime:2500,idle:!0,trigger:{}}),h=a(b),i=function(){g.idle||(g.idle=!0,g.trigger.userinactive&&h.trigger("userinactive"))},j=function(a){!a||"mousemove"===a.type&&a.pageX===e&&a.pageY===f||("mousemove"===a.type&&(e=a.pageX,f=a.pageY),g.idleTimer&&clearTimeout(g.idleTimer),g.idleTimer=setTimeout(i,g.idletime),g.idle&&(g.idle=!1,g.trigger.useractive&&h.trigger("useractive")))};g.idletime=(c||{}).idletime||g.idletime,c&&"idle"in c&&(g.idle=c.idle),g.trigger[d]=!0,g.bound||(h.bind("mouseleave.jmeuseractivity",i).bind("mousemove.jmeuseractivity focusin.jmeuseractivity mouseenter.jmeuseractivity keydown.jmeuseractivity keyup.jmeuseractivity mousedown.jmeuseractivity",j),g.bound=!0),g.idle||j({type:"initunidled"})},remove:function(b,c){var d=a.data(b,"jmeuseractivity")||a.data(b,"jmeuseractivity",{idletime:2500,idle:!0,trigger:{}});d.trigger[c]=!1,d.trigger.useractive||d.trigger.userinactive||(a(b).unbind(".jmeuseractivity"),d.bound=!1)}};a.each(["useractive","userinactive"],function(c,d){a.event.special[d]={setup:function(a){b.add(this,a,d)},teardown:function(){b.remove(this,d)}}})}()}(jQuery),function(a){function b(a,b){var c,d,e;return{get:function(){return e?void 0:a.apply(this,arguments)},set:function(){clearTimeout(c),clearTimeout(d);var a=this,f=arguments;e=!0,c=setTimeout(function(){b.apply(a,f),d=setTimeout(function(){e=!1},30)},0)}}}var c="pseudoClasses",d={play:1,playing:1},e={pause:1,ended:1},f=(!(Modernizr.boxSizing||Modernizr["display-table"]||Modernizr.video||a.support.getSetAttribute),function(){a.webshims.loader&&a.webshims.loader.loadList(["range-ui"])}),g=function(b){f(),a.webshims.ready("range-ui",b)},h='{%text%} ',i='
',j='
';a.jme.registerPlugin("play-pause",{pseudoClasses:{play:"state-paused",pause:"state-playing"},structure:h,text:"play / pause",_create:function(b,f){var g=a.jme.getButtonText(b,[this[c].play,this[c].pause]);f.bind("play playing ended pause updateJMEState",function(a){var b=a.type;b=d[b]?1:e[b]?0:f.jmeProp("isPlaying")?1:0,g(b)}).triggerHandler("updateJMEState"),b.bind(b.is("select")?"change":"click",function(a){f.jmeFn("togglePlay"),a.stopPropagation()})}}),a.jme.registerPlugin("mute-unmute",{pseudoClasses:{mute:"state-mute",unmute:"state-unmute"},structure:h,text:"mute / unmute",_create:function(b,d){var e=a.jme.getButtonText(b,[this[c].mute,this[c].unmute]);d.bind("volumechange updateJMEState",function(){e(d.prop("muted")?1:0)}).triggerHandler("updateJMEState"),b.bind(b.is("select")?"change":"click",function(a){d.prop("muted",!d.prop("muted")),a.stopPropagation()})}}),a.jme.registerPlugin("volume-slider",{structure:j,_create:function(a,c){f();var d=function(){var d,e;e=b(function(){var a=c.prop("volume");void 0!==a&&d.value(a)},function(){c.prop({muted:!1,volume:d.options.value})}),d=a.rangeUI({min:0,max:1,step:"any",input:function(){e.set()}}).data("rangeUi"),c.bind("volumechange",e.get)};g(d)}}),a.jme.registerPlugin("time-slider",{structure:j,pseudoClasses:{no:"no-duration"},options:{format:["mm","ss"]},_create:function(d,e,h){f();var i=this,j=function(){var f,g,j,k,l=a.jme.classNS+"has-duration",m=(a.jme.classNS+"no-duration",e.prop("duration"));f=b(function(){var a=e.prop("currentTime");if(!isNaN(a))try{j.value(a)}catch(b){}},function(){try{e.prop("currentTime",j.options.value).triggerHandler("timechanged",[j.options.value])}catch(a){}}),g=function(){m=e.prop("duration"),l=m&&isFinite(m)&&!isNaN(m),l?(j.disabled(!1),j.max(m),h.removeClass(i[c].no)):(j.disabled(!0),j.max(Number.MAX_VALUE),h.addClass(i[c].no))},j=d.rangeUI({min:0,value:e.prop("currentTime")||0,step:"any",input:function(){f.set()},textValue:function(a){return e.jmeFn("formatTime",a)}}).data("rangeUi"),k=a(' ').appendTo(d),d.on({mouseenter:function(b){if(l){var c=(d.offset()||{left:0}).left,f=d.innerWidth(),g=function(a){var b=(a-c)/f*100;k.html(e.jmeFn("formatTime",m*b/100)).css({left:b+"%"})};g(b.pageX),k.addClass(a.jme.classNS+"show-time-select"),d.off(".jmetimeselect").on("mousemove.jmetimeselect",function(a){g(a.pageX)})}},mouseleave:function(){k.removeClass(a.jme.classNS+"show-time-select"),d.off(".jmetimeselect")}}),e.bind({timeupdate:f.get,emptied:function(){g(),j.value(0)},durationchange:g}),h.jmeFn("addControls",a('
').prependTo(d)),g()};g(j)}}),a.jme.defineMethod("concerningRange",function(b,c){var d=this,e={start:0,end:0};if(b||(b="buffered"),b=a.prop(d,b),null==c&&(c=a.prop(d,"currentTime")),!(b&&"length"in b))return e;for(var f=0,g=b.length;g>f&&(e.start=b.start(f),e.end=b.end(f),!(e.start<=c&&e.end>=c));f++);return e}),a.jme.defineProp("progress",{get:function(b){var c=a.jme.data(b);if(!c.media)return 0;var d=c.media.jmeFn("concerningRange").end/c.media.prop("duration")*100;return d>99.4&&(d=100),d||0},readonly:!0}),a.jme.registerPlugin("buffer-progress",{_create:function(b,c,d,e){var f=a('
').appendTo(b),g=function(){var a=c.jmeProp("progress");e.progress!==a&&(e.progress=a,f.css("width",a+"%"))};c.bind({progress:g,emptied:function(){f.css("width",0),e.progress=0},playing:g}),g()}});var k={hh:6e4,mm:60,ss:1,ms:.001},l=function(b,c){var d;c||(c=["mm","ss"]),null==b&&(d=a.jme.data(this),b=a.prop(d.media,"duration")),b||(b=0);for(var e,f=[],g=0,h=c.length;h>g;g++)"ms"==c[g]&&g==h-1?e=Math.round(b/k[c[g]]/10):(e=parseInt(b/k[c[g]],10),b%=k[c[g]]),10>e&&(e="0"+e),f.push(e);return f.join(":")};a.jme.defineMethod("formatTime",l),a.jme.defineProp("format",{set:function(b,c){a.isArray(c)||(c=c.split(":"));var d=a.jme.data(b);return d.format=c,a(b).triggerHandler("updatetimeformat"),d.player.triggerHandler("updatetimeformat"),"noDataSet"}}),a.jme.registerPlugin("duration-display",{structure:i,options:{format:"mm:ss"},_create:function(a,b,c,d){"string"==typeof d.format&&(d.format=d.format.split(":"));var e=function(){a.html(l(b.prop("duration"),d.format))};b.bind("durationchange emptied",e),a.bind("updatetimeformat",e).jmeProp("format",d.format)}}),a.jme.defineProp("countdown",{set:function(b,c){var d=a.jme.data(b);return d.countdown=!!c,a(b).triggerHandler("updatetimeformat"),d.player.triggerHandler("updatetimeformat"),"noDataSet"}}),a.jme.registerPlugin("currenttime-display",{structure:i,options:{format:"mm:ss",countdown:!1},_create:function(a,b,c,d){"string"==typeof d.format&&(d.format=d.format.split(":"));var e=function(){var c=b.prop("currentTime");d.countdown&&(c=(b.prop("duration")||0)-c,.7>c&&(c=0)),a.html(l(c,d.format))};b.bind("timeupdate emptied durationchange",e),a.bind("updatetimeformat",e).jmeProp("format",d.format)}}),a.jme.registerPlugin("poster-display",{structure:"
",options:{},_create:function(b,c){var d=function(){var d=c.prop("poster");d?b.html(' '):b.empty()};c.bind("emptied",d),d()}})}(jQuery),function(a){var b;a.jme.startJME=function(){if(!b){a.webshims.loader&&setTimeout(function(){a.webshims.loader.loadList(["range-ui"])},0),a(function(){a.jme.createSelectors(),a.jme.initJME(document,a([]))}),a.webshims.ready("mediaelement",function(){a.webshims.addReady(function(b,c){b!==document&&a.jme.initJME(b,c)})}),b=!0}},a(window).trigger("jmepluginready")}(window.webshims&&webshims.$||jQuery),function(a){var b=window.webshims&&webshims.$||jQuery;b.jme?a(b):b(window).on("jmepluginready",function(){a(b)})}(function(a){var b='{%text%} ',c="pseudoClasses";a.jme.fullscreen=function(){var b,c,d=document.documentElement,e={supportsFullScreen:Modernizr.prefixed("fullscreenEnabled",document,!1)||Modernizr.prefixed("fullScreenEnabled",document,!1),isFullScreen:function(){return!1},requestFullScreen:function(d){var e;b=[],a(d).parentsUntil("body").each(function(){var c,d=a.css(this,"position"),f=this.scrollLeft,g=this.scrollTop;e={elemStyle:this.style,elem:this},"static"!==d&&(c=!0,e.pos=e.elemStyle.position,this.style.position="static"),f&&(c=!0,e.left=f),g&&(c=!0,e.top=g),c&&b.push(e)}),c=!1;try{c={elemStyle:frameElement.style,elem:frameElement,css:{}},c.css.position=c.elemStyle.position,c.elemStyle.position="fixed",a.each(["top","left","right","bottom"],function(a,b){c.css[b]=c.elemStyle[b],c.elemStyle[b]="0px"}),a.each(["height","width"],function(a,b){c.css[b]=c.elemStyle[b],c.elemStyle[b]="100%"})}catch(f){c=!1}e=null},cancelFullScreen:function(){b&&(a.each(b,function(a,b){"pos"in b&&(b.elemStyle.position=b.pos),b.left&&(b.elem.scrollLeft=b.left),b.top&&(b.elem.scrollTop=b.top),b=null}),b=[]),c&&(a.each(c.css,function(a,b){c.elemStyle[a]=b}),c=!1)},eventName:"fullscreenchange",exitName:"exitFullscreen",requestName:"requestFullscreen",elementName:"fullscreenElement",enabledName:""};return e.cancelFullWindow=e.cancelFullScreen,e.requestFullWindow=e.requestFullScreen,e.supportsFullScreen&&(e.enabledName=e.supportsFullScreen,e.exitName=Modernizr.prefixed("exitFullscreen",document,!1)||Modernizr.prefixed("cancelFullScreen",document,!1),e.elementName=Modernizr.prefixed("fullscreenElement",document,!1)||Modernizr.prefixed("fullScreenElement",document,!1),e.supportsFullScreen=!!e.supportsFullScreen,("fullscreenElement"!=e.elementName||"exitFullscreen"!=e.exitName||"fullscreenEnabled"!=e.enabledName)&&a.each(Modernizr._domPrefixes,function(a,b){var c=b+"RequestFullscreen";return c in d||(c=b+"RequestFullScreen")&&c in d?(e.eventName=b+"fullscreenchange",e.requestName=c,!1):void 0}),e.isFullScreen=function(){return document[e.elementName]},e.requestFullScreen=function(a){return a[e.requestName]()},e.cancelFullScreen=function(){return document[e.exitName]()}),window.Modernizr&&"fullscreen"in Modernizr||a("html").addClass(e.supportsFullScreen?"fullscreen":"no-fullscreen"),window.parent!=window&&!function(){try{{var b=window.frameElement;b.style}e.supportsFullScreen&&("allowfullscreen"in b&&!b.allowfullscreen?b.allowfullscreen=!0:(null==b.getAttribute("webkitallowfullscreen")&&b.setAttribute("webkitallowfullscreen",""),null==b.getAttribute("allowfullscreen")&&b.setAttribute("allowfullscreen","allowfullscreen")))}catch(c){e.supportsFullScreen||a("html").addClass("no-fullwindow")}}(),e}(),a.jme.defineProp("fullscreen",{set:function(b,c){var d=a.jme.data(b);if(!(d&&d.player||a(b).hasClass(a.jme.classNS+"player-fullscreen")))return"noDataSet";if(c){if(d.player.hasClass(a.jme.classNS+"player-fullscreen"))return"noDataSet";if(d.scrollPos={top:a(window).scrollTop(),left:a(window).scrollLeft()},a(document).unbind(".jmefullscreen").bind("keydown.jmefullscreen",function(a){return 27==a.keyCode?(d.player.jmeProp("fullscreen",!1),!1):32!==a.keyCode||"form"in a.target?void 0:(d.media.jmeFn("togglePlay"),!1)}),"fullwindow"==c)a.jme.fullscreen.requestFullWindow(d.player[0]);else try{a.jme.fullscreen.requestFullScreen(d.player[0])}catch(e){}a("html").addClass(a.jme.classNS+"has-media-fullscreen"),d.player.addClass(a.jme.classNS+"player-fullscreen"),d.media.addClass(a.jme.classNS+"media-fullscreen"),a(".jme-default-control-bar",d.player).focus(),a.jme.fullscreen.supportsFullScreen&&a(document).bind(a.jme.fullscreen.eventName+".jmefullscreen",function(){var c=a.jme.fullscreen.isFullScreen();c&&b==c?a(b).triggerHandler("playerdimensionchange",["fullscreen"]):d.player.jmeProp("fullscreen",!1)}),d.player.triggerHandler("playerdimensionchange",["fullwindow"])}else{if(d.player&&!d.player.hasClass(a.jme.classNS+"player-fullscreen"))return"noDataSet";if(a(document).unbind(".jmefullscreen"),a("html").removeClass(a.jme.classNS+"has-media-fullscreen"),d.player&&d.media&&(d.player.removeClass(a.jme.classNS+"player-fullscreen"),d.media.removeClass(a.jme.classNS+"media-fullscreen")),a.jme.fullscreen.isFullScreen())try{a.jme.fullscreen.cancelFullScreen()}catch(e){}else a.jme.fullscreen.cancelFullWindow();d.player&&d.player.triggerHandler("playerdimensionchange"),d.scrollPos&&(a(window).scrollTop(d.scrollPos.top),a(window).scrollLeft(d.scrollPos.left),delete d.scrollPos)}return"noDataSet"},get:function(b){var c=a.jme.data(b);if(c&&c.player){var d=c.player.hasClass(a.jme.classNS+"player-fullscreen");return d?a.jme.fullscreen.isFullScreen()||"fullwindow":!1}}}),a.jme.defineProp("autoplayfs"),a.jme.registerPlugin("fullscreen",{pseudoClasses:{enter:"state-enterfullscreen",exit:"state-exitfullscreen"},options:{fullscreen:!0,autoplayfs:!1},structure:b,text:"enter fullscreen / exit fullscreen",_create:function(b,d,e){var f=a.jme.getButtonText(b,[this[c].enter,this[c].exit]),g=function(){f(e.hasClass(a.jme.classNS+"player-fullscreen")?1:0)},h=this.options,i=function(){a(e.data("jme").controlElements).filter(".jme-default-media-overlay").off(".dblfullscreen").on("dblclick.dblfullscreen",function(){e.jmeProp("fullscreen",!e.jmeProp("fullscreen"))})};e.on("controlsadded",i),e.bind("playerdimensionchange",g),b.bind(b.is("select")?"change":"click",function(){var b=e.hasClass(a.jme.classNS+"player-fullscreen")?!1:h.fullscreen;e.jmeProp("fullscreen",b),b&&h.autoplayfs&&d.jmeFn("play")}),i(),g()}})}),function(a){var b=window.webshims&&webshims.$||jQuery;b.jme?a(b):b(window).on("jmepluginready",function(){a(b)})}(function(a){var b='{%text%} ',c="pseudoClasses";a.jme.ButtonMenu=function(b,c,d){this.button=a(b).attr({"aria-haspopup":"true"}),this.clickHandler=d,this.toggle=a.proxy(this,"toggle"),this.keyIndex=a.proxy(this,"keyIndex"),this._buttonClick=a.proxy(this,"_buttonClick"),this.addMenu(c),this._closeFocusOut(),this.button.bind("click",this.toggle)},a.jme.ButtonMenu.prototype={addMenu:function(b){this.menu&&this.menu.remove(),this.menu=a(b),this.buttons=a("button",this.menu),this.menu.insertAfter(this.button),this.menu.bind("keydown",this.keyIndex).delegate("button","click",this._buttonClick)},_closeFocusOut:function(){var a,b=this,c=function(){clearTimeout(a),setTimeout(function(){clearTimeout(a)},9)};this.menu.parent().on("focusin",c).on("mousedown",c).on("focusout",function(){a=setTimeout(function(){b.hide()},40)})},_buttonClick:function(a){this.clickHandler(this.buttons.index(a.currentTarget),a.currentTarget),this.hide()},keyIndex:function(a){var b=40==a.keyCode?1:38==a.keyCode?-1:0;if(b){var c=this.buttons.not(":disabled"),d=c.filter(":focus");d=c[c.index(d)+b]||c.filter(b>0?":first":":last"),d.focus(),a.preventDefault()}},show:function(){if(!this.isVisible){var b=this.buttons.not(":disabled");this.isVisible=!0,this.menu.addClass("visible-menu");try{this.activeElement=document.activeElement||this.button[0]}catch(c){this.activeElement=this.button[0]}setTimeout(function(){a(b.filter('[aria-checked="true"]')[0]||b[0]).focus()},60)}},toggle:function(){this[this.isVisible?"hide":"show"]()},hide:function(){if(this.isVisible){if(this.isVisible=!1,this.menu.removeClass("visible-menu"),this.activeElement)try{this.activeElement.focus()}catch(a){}this.activeElement=!1}}};var d={subtitles:1,caption:1},e=function(b){var c=a.map(b,function(a){var b="caption"==a.kind?"caption-type":"subtitle-type",c=a.language;return c=c?' '+c+" ":"",''+a.label+c+" "});return""};a.jme.registerPlugin("captions",{pseudoClasses:{enabled:"state-captionsenabled",disabled:"state-captionsdisabled",noTrack:"no-track",hasTrack:"has-track",menu:"subtitle-menu"},structure:b,text:"subtitles menu",_create:function(b,f,g){var h=this,i=f.find("track"),j=a(b).clone().attr({role:"checkbox"}).insertBefore(b),k=a("span.jme-text, +label span.jme-text",b);k[0]||(k=b),k.html(h.text),i.length?g.addClass(h[c].hasTrack):(b.prop("disabled",!0),g.addClass(h[c].noTrack)),g.attr("data-tracks",i.length),webshims.ready("track",function(){function i(c){var d;m?m.addMenu(c):(d=function(b,c){"true"==a.attr(c,"aria-checked")?o[b].mode="disabled":a.each(o,function(a,c){c.mode=a==b?"showing":"disabled"}),f.prop("textTracks"),k()},m=new a.jme.ButtonMenu(b,c,d),j.on("click",function(){return d(0,this),!1})),k()}function k(){a("button",m.menu).each(function(b){var c="showing"==o[b].mode?"true":"false";b||j.attr("aria-checked",c),a.attr(this,"aria-checked",c)})}function l(){o=[],a.each(p,function(a,b){d[b.kind]&&3!=b.readyState&&o.push(b)}),g.attr("data-tracks",o.length),o.length?(i('"),a("span.jme-text, +label span.jme-text",j).text((o[0].label||" ")+(o[0].lang||"")),(!g.hasClass(h[c].hasTrack)||g.hasClass(h[c].noTrack))&&(b.prop("disabled",!1),g.addClass(h[c].hasTrack).removeClass(h[c].noTrack).triggerHandler("controlschanged"))):(!g.hasClass(h[c].noTrack)||g.hasClass(h[c].hasTrack))&&(b.prop("disabled",!0),g.addClass(h[c].noTrack).removeClass(h[c].hasTrack).triggerHandler("controlschanged"))}var m,n,o=[],p=f.prop("textTracks"),q=function(){var a,b;return function(c){clearTimeout(a),clearTimeout(b),"updatesubtitlestate"==c.type&&(b=setTimeout(function(){f.trigger("updatetracklist")},0)),a=setTimeout(l,19)}}();p?(n=function(){var a;return function(){clearTimeout(a),a=setTimeout(k,20)}}(),l(),a([p]).on("addtrack removetrack",q).on("change",n),g.on("updatesubtitlestate",q),f.on("updatetrackdisplay",n)):(p=[],l())})}})});
--------------------------------------------------------------------------------
/demo/js/plugins/jme.embed.min.js:
--------------------------------------------------------------------------------
1 | !function(a){var b,c=/%20/g;if(a("html").hasClass("jme-embedded-player")){var d,e=(location.search||"").replace(/^\?/,"").split("&");if(a.each(e,function(a,b){return b=b.split("="),"jmeembed"==b[0]?(d=b[1],!1):void 0}),d){d=decodeURIComponent(d.replace(/\+/g," "));try{d=JSON.parse(d)}catch(f){}"object"==typeof d&&d.e&&(d.a.title&&(document.title=d.a.title),a(function(){var b=a('
').prependTo("body").data("jme",{controlbar:!0});"video"==d.e&&(d.a.preload="none"),a.jme||(d.a.controls="controls");var c=a(document.createElement(d.e)).attr(d.a).appendTo(b);"video"==d.e&&c.css({width:"100%",height:"100%"}),a.each(d.c,function(b,d){a(document.createElement(d.e)).attr(d.a).appendTo(c)}),a("body").updatePolyfill(),c.mediaLoad()}))}}!function(b){a.jme?b(a):a(window).on("jmepluginready",function(){b(a)})}(function(a){var d=function(){d.run||(a.jme.options.embeddedPlayer&&(b=a.jme.options.embeddedPlayer),b?b+=-1!=b.indexOf("?")?"&":"?":window.console&&console.log("you need to define a path to the embedded player $.jme.options.embeddedPlayer")),d.run=!0};a.jme.defineMethod("getIframe",function(b,c){b||(b=640),c||(c=360),/\d$/.test(""+b)&&(b+="px"),/\d$/.test(""+c)&&(c+="px");var d="width: "+b+"; height: "+c+"; overflow: hidden; border: none;";return''}),a.jme.defineProp("embedUrl",{get:function(e){d();var f=a.jme.data(e),g=(f.media.prop("src"),{a:{},c:[]});return f.media.each(function(){g.e=f.media.prop("nodeName").toLowerCase(),a.each(["poster","src","autoplay","loop","muted","title"],function(a,b){var c=f.media.attr(b);null!=c&&(g.a[b]=f.media.prop(b))}),a("track",f.media).each(function(){var b=a(this),c={e:"track",a:{}};g.c.push(c),a.each(["src","srclang","kind","label"],function(a,d){var e=b.attr(d);null!=e&&(c.a[d]=b.prop(d))})}),a("source",f.media).each(function(){var b=a(this),c={e:"source",a:{}};g.c.push(c),a.each(["src","media","type"],function(a,d){var e=b.attr(d);null!=e&&(c.a[d]=b.prop(d))})})}),b+"jmeembed="+encodeURIComponent(JSON.stringify(g)).replace(c,"+")},readonly:!0})})}(window.webshims&&webshims.$||jQuery);
--------------------------------------------------------------------------------
/demo/js/plugins/jme.fullscreen.min.js:
--------------------------------------------------------------------------------
1 | !function(a){var b=window.webshims&&webshims.$||jQuery;b.jme?a(b):b(window).on("jmepluginready",function(){a(b)})}(function(a){var b='{%text%} ',c="pseudoClasses";a.jme.fullscreen=function(){var b,c,d=document.documentElement,e={supportsFullScreen:Modernizr.prefixed("fullscreenEnabled",document,!1)||Modernizr.prefixed("fullScreenEnabled",document,!1),isFullScreen:function(){return!1},requestFullScreen:function(d){var e;b=[],a(d).parentsUntil("body").each(function(){var c,d=a.css(this,"position"),f=this.scrollLeft,g=this.scrollTop;e={elemStyle:this.style,elem:this},"static"!==d&&(c=!0,e.pos=e.elemStyle.position,this.style.position="static"),f&&(c=!0,e.left=f),g&&(c=!0,e.top=g),c&&b.push(e)}),c=!1;try{c={elemStyle:frameElement.style,elem:frameElement,css:{}},c.css.position=c.elemStyle.position,c.elemStyle.position="fixed",a.each(["top","left","right","bottom"],function(a,b){c.css[b]=c.elemStyle[b],c.elemStyle[b]="0px"}),a.each(["height","width"],function(a,b){c.css[b]=c.elemStyle[b],c.elemStyle[b]="100%"})}catch(f){c=!1}e=null},cancelFullScreen:function(){b&&(a.each(b,function(a,b){"pos"in b&&(b.elemStyle.position=b.pos),b.left&&(b.elem.scrollLeft=b.left),b.top&&(b.elem.scrollTop=b.top),b=null}),b=[]),c&&(a.each(c.css,function(a,b){c.elemStyle[a]=b}),c=!1)},eventName:"fullscreenchange",exitName:"exitFullscreen",requestName:"requestFullscreen",elementName:"fullscreenElement",enabledName:""};return e.cancelFullWindow=e.cancelFullScreen,e.requestFullWindow=e.requestFullScreen,e.supportsFullScreen&&(e.enabledName=e.supportsFullScreen,e.exitName=Modernizr.prefixed("exitFullscreen",document,!1)||Modernizr.prefixed("cancelFullScreen",document,!1),e.elementName=Modernizr.prefixed("fullscreenElement",document,!1)||Modernizr.prefixed("fullScreenElement",document,!1),e.supportsFullScreen=!!e.supportsFullScreen,("fullscreenElement"!=e.elementName||"exitFullscreen"!=e.exitName||"fullscreenEnabled"!=e.enabledName)&&a.each(Modernizr._domPrefixes,function(a,b){var c=b+"RequestFullscreen";return c in d||(c=b+"RequestFullScreen")&&c in d?(e.eventName=b+"fullscreenchange",e.requestName=c,!1):void 0}),e.isFullScreen=function(){return document[e.elementName]},e.requestFullScreen=function(a){return a[e.requestName]()},e.cancelFullScreen=function(){return document[e.exitName]()}),window.Modernizr&&"fullscreen"in Modernizr||a("html").addClass(e.supportsFullScreen?"fullscreen":"no-fullscreen"),window.parent!=window&&!function(){try{{var b=window.frameElement;b.style}e.supportsFullScreen&&("allowfullscreen"in b&&!b.allowfullscreen?b.allowfullscreen=!0:(null==b.getAttribute("webkitallowfullscreen")&&b.setAttribute("webkitallowfullscreen",""),null==b.getAttribute("allowfullscreen")&&b.setAttribute("allowfullscreen","allowfullscreen")))}catch(c){e.supportsFullScreen||a("html").addClass("no-fullwindow")}}(),e}(),a.jme.defineProp("fullscreen",{set:function(b,c){var d=a.jme.data(b);if(!(d&&d.player||a(b).hasClass(a.jme.classNS+"player-fullscreen")))return"noDataSet";if(c){if(d.player.hasClass(a.jme.classNS+"player-fullscreen"))return"noDataSet";if(d.scrollPos={top:a(window).scrollTop(),left:a(window).scrollLeft()},a(document).unbind(".jmefullscreen").bind("keydown.jmefullscreen",function(a){return 27==a.keyCode?(d.player.jmeProp("fullscreen",!1),!1):32!==a.keyCode||"form"in a.target?void 0:(d.media.jmeFn("togglePlay"),!1)}),"fullwindow"==c)a.jme.fullscreen.requestFullWindow(d.player[0]);else try{a.jme.fullscreen.requestFullScreen(d.player[0])}catch(e){}a("html").addClass(a.jme.classNS+"has-media-fullscreen"),d.player.addClass(a.jme.classNS+"player-fullscreen"),d.media.addClass(a.jme.classNS+"media-fullscreen"),a(".jme-default-control-bar",d.player).focus(),a.jme.fullscreen.supportsFullScreen&&a(document).bind(a.jme.fullscreen.eventName+".jmefullscreen",function(){var c=a.jme.fullscreen.isFullScreen();c&&b==c?a(b).triggerHandler("playerdimensionchange",["fullscreen"]):d.player.jmeProp("fullscreen",!1)}),d.player.triggerHandler("playerdimensionchange",["fullwindow"])}else{if(d.player&&!d.player.hasClass(a.jme.classNS+"player-fullscreen"))return"noDataSet";if(a(document).unbind(".jmefullscreen"),a("html").removeClass(a.jme.classNS+"has-media-fullscreen"),d.player&&d.media&&(d.player.removeClass(a.jme.classNS+"player-fullscreen"),d.media.removeClass(a.jme.classNS+"media-fullscreen")),a.jme.fullscreen.isFullScreen())try{a.jme.fullscreen.cancelFullScreen()}catch(e){}else a.jme.fullscreen.cancelFullWindow();d.player&&d.player.triggerHandler("playerdimensionchange"),d.scrollPos&&(a(window).scrollTop(d.scrollPos.top),a(window).scrollLeft(d.scrollPos.left),delete d.scrollPos)}return"noDataSet"},get:function(b){var c=a.jme.data(b);if(c&&c.player){var d=c.player.hasClass(a.jme.classNS+"player-fullscreen");return d?a.jme.fullscreen.isFullScreen()||"fullwindow":!1}}}),a.jme.defineProp("autoplayfs"),a.jme.registerPlugin("fullscreen",{pseudoClasses:{enter:"state-enterfullscreen",exit:"state-exitfullscreen"},options:{fullscreen:!0,autoplayfs:!1},structure:b,text:"enter fullscreen / exit fullscreen",_create:function(b,d,e){var f=a.jme.getButtonText(b,[this[c].enter,this[c].exit]),g=function(){f(e.hasClass(a.jme.classNS+"player-fullscreen")?1:0)},h=this.options,i=function(){a(e.data("jme").controlElements).filter(".jme-default-media-overlay").off(".dblfullscreen").on("dblclick.dblfullscreen",function(){e.jmeProp("fullscreen",!e.jmeProp("fullscreen"))})};e.on("controlsadded",i),e.bind("playerdimensionchange",g),b.bind(b.is("select")?"change":"click",function(){var b=e.hasClass(a.jme.classNS+"player-fullscreen")?!1:h.fullscreen;e.jmeProp("fullscreen",b),b&&h.autoplayfs&&d.jmeFn("play")}),i(),g()}})});
--------------------------------------------------------------------------------
/demo/js/plugins/jme.track.min.js:
--------------------------------------------------------------------------------
1 | (function(e){var t=window.jQuery;t.jme?e(t):t(window).on("jmepluginready",function(){e(t)})})(function(e){var t='{%text%} ',n="pseudoClasses";e.jme.ButtonMenu=function(t,n,a){this.button=e(t).attr({"aria-haspopup":"true"}),this.clickHandler=a,this.toggle=e.proxy(this,"toggle"),this.keyIndex=e.proxy(this,"keyIndex"),this._buttonClick=e.proxy(this,"_buttonClick"),this.addMenu(n),this._closeFocusOut(),this.button.bind("click",this.toggle)},e.jme.ButtonMenu.prototype={addMenu:function(t){this.menu&&this.menu.remove(),this.menu=e(t),this.buttons=e("button",this.menu),this.menu.insertAfter(this.button),this.menu.bind("keydown",this.keyIndex).delegate("button","click",this._buttonClick)},_closeFocusOut:function(){var e,t=this,n=function(){clearTimeout(e),setTimeout(function(){clearTimeout(e)},9)};this.menu.parent().bind("focusin",n).bind("mousedown",n).bind("focusout",function(){e=setTimeout(function(){t.hide()},40)})},_buttonClick:function(e){this.clickHandler(this.buttons.index(e.currentTarget),e.currentTarget),this.hide()},keyIndex:function(e){var t=40==e.keyCode?1:38==e.keyCode?-1:0;if(t){var n=this.buttons.not(":disabled"),a=n.filter(":focus");a=n[n.index(a)+t]||n.filter(t>0?":first":":last"),a.focus(),e.preventDefault()}},show:function(){if(!this.isVisible){var t=this.buttons.not(":disabled");this.isVisible=!0,this.menu.addClass("visible-menu");try{this.activeElement=document.activeElement||this.button[0]}catch(n){this.activeElement=this.button[0]}setTimeout(function(){e(t.filter('[aria-checked="true"]')[0]||t[0]).focus()},60)}},toggle:function(){this[this.isVisible?"hide":"show"]()},hide:function(){if(this.isVisible){if(this.isVisible=!1,this.menu.removeClass("visible-menu"),this.activeElement)try{this.activeElement.focus()}catch(e){}this.activeElement=!1}}};var a={subtitles:1,caption:1},i=function(t){var n=e.map(t,function(e){var t="caption"==e.kind?"caption-type":"subtitle-type",n=e.language;return n=n?' '+n+" ":"",''+e.label+n+" "});return""};e.jme.registerPlugin("captions",{pseudoClasses:{enabled:"state-captionsenabled",disabled:"state-captionsdisabled",noTrack:"no-track",hasTrack:"has-track",menu:"subtitle-menu"},structure:t,text:"subtitles menu",_create:function(t,r,s){var o=this,l=r.find("track"),u=e("span.jme-text, +label span.jme-text",t);u[0]||(u=t),u.html(o.text),l.length?s.addClass(o[n].hasTrack):(t.prop("disabled",!0),s.addClass(o[n].noTrack)),e.webshims.ready("track",function(){function l(n){d?d.addMenu(n):d=new e.jme.ButtonMenu(t,n,function(t,n){"true"==e.attr(n,"aria-checked")?m[t].mode="disabled":e.each(m,function(e,n){n.mode=e==t?"showing":"disabled"}),r.prop("textTracks"),u()}),u()}function u(){e("button",d.menu).each(function(t){e.attr(this,"aria-checked","showing"==m[t].mode?"true":"false")})}function c(){m=[],e.each(p,function(e,t){a[t.kind]&&3!=t.readyState&&m.push(t)}),m.length?(l('"),(!s.hasClass(o[n].hasTrack)||s.hasClass(o[n].noTrack))&&(t.prop("disabled",!1),s.addClass(o[n].hasTrack).removeClass(o[n].noTrack).triggerHandler("controlschanged"))):(!s.hasClass(o[n].noTrack)||s.hasClass(o[n].hasTrack))&&(t.prop("disabled",!0),s.addClass(o[n].noTrack).removeClass(o[n].hasTrack).triggerHandler("controlschanged"))}var d,m=[],p=r.prop("textTracks"),f=function(){var e,t;return function(n){clearTimeout(e),clearTimeout(t),"updatesubtitlestate"==n.type&&(t=setTimeout(function(){r.trigger("updatetracklist")},0)),e=setTimeout(c,19)}}();p?(c(),e([p]).on("addtrack removetrack",f),s.bind("updatesubtitlestate",f),r.bind("updatetrackdisplay",function(){var e;return function(){clearTimeout(e),e=setTimeout(u,20)}}())):(p=[],c())})}})});
--------------------------------------------------------------------------------
/demo/media/sintel/cc-by.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aFarkas/jMediaelement/d6d7391ad9695eab92ae725747488099f4eb75b0/demo/media/sintel/cc-by.png
--------------------------------------------------------------------------------
/demo/media/sintel/sintel-trailer.m4v:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aFarkas/jMediaelement/d6d7391ad9695eab92ae725747488099f4eb75b0/demo/media/sintel/sintel-trailer.m4v
--------------------------------------------------------------------------------
/demo/media/sintel/sintel-trailer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aFarkas/jMediaelement/d6d7391ad9695eab92ae725747488099f4eb75b0/demo/media/sintel/sintel-trailer.png
--------------------------------------------------------------------------------
/demo/media/sintel/sintel-trailer.webm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aFarkas/jMediaelement/d6d7391ad9695eab92ae725747488099f4eb75b0/demo/media/sintel/sintel-trailer.webm
--------------------------------------------------------------------------------
/demo/media/sintel/sintel-trailer_de.vtt:
--------------------------------------------------------------------------------
1 | WEBVTT
2 |
3 | 1
4 | 00:00:11.400 --> 00:00:15.800
5 | ...was führt dich in die Lande der
6 | Torwaechter?
7 |
8 | 2
9 | 00:00:18.000 --> 00:00:20.500
10 | Ich suche jemanden.
11 |
12 | 3
13 | 00:00:36.850 --> 00:00:39.750
14 | Ein gefährliches Unterfangen für eine
15 | einsame Jägerin.
16 |
17 | 4
18 | 00:00:40.950 --> 00:00:43.870
19 | Ich bin einsam, solange ich mich
20 | erinnern kann.
21 |
22 |
--------------------------------------------------------------------------------
/demo/media/sintel/sintel-trailer_en.vtt:
--------------------------------------------------------------------------------
1 | WEBVTT
2 |
3 | 1
4 | 00:00:11.400 --> 00:00:15.800
5 | What brings you to
6 | the land of the gatekeepers?
7 |
8 | 2
9 | 00:00:18.000 --> 00:00:20.500
10 | I'm searching for someone.
11 |
12 | 3
13 | 00:00:36.850 --> 00:00:39.750
14 | A dangerous quest for a lone hunter.
15 |
16 | 4
17 | 00:00:40.950 --> 00:00:43.870
18 | I've been alone for
19 | as long as I can remember.
20 |
21 |
--------------------------------------------------------------------------------
/demo/media/sintel/sintel-trailer_es.vtt:
--------------------------------------------------------------------------------
1 | WEBVTT
2 |
3 | 1
4 | 00:00:11.400 --> 00:00:15.800
5 | Qué te trae a la tierra
6 | de los guardianes?
7 |
8 | 2
9 | 00:00:18.000 --> 00:00:20.500
10 | Estoy buscando a alguien.
11 |
12 | 3
13 | 00:00:36.850 --> 00:00:39.750
14 | Una aventura peligrosa
15 | para una cazadora solitaria.
16 |
17 | 4
18 | 00:00:40.950 --> 00:00:43.870
19 | He estado sola desde
20 | que tengo memoria.
21 |
22 |
--------------------------------------------------------------------------------
/demo/media/sintel/sintel-trailer_fr.vtt:
--------------------------------------------------------------------------------
1 | WEBVTT
2 |
3 | 1
4 | 00:00:11.400 --> 00:00:15.800
5 | Qu'est-ce qui t'amène
6 | sur la terre des gardiens ?
7 |
8 | 2
9 | 00:00:18.000 --> 00:00:20.500
10 | Je recherche quelqu'un.
11 |
12 | 3
13 | 00:00:36.850 --> 00:00:39.750
14 | Une quête dangereuse pour une chasseresse solitaire.
15 |
16 | 4
17 | 00:00:40.950 --> 00:00:43.870
18 | J'ai été seule
19 | aussi longtemps que je m'en souvienne.
20 |
21 |
--------------------------------------------------------------------------------
/demo/media/sintel/sintel-trailer_it.vtt:
--------------------------------------------------------------------------------
1 | WEBVTT
2 |
3 | 1
4 | 00:00:11.400 --> 00:00:15.800
5 | Cosa ti porta nella terra
6 | dei guardiani?
7 |
8 | 2
9 | 00:00:18.000 --> 00:00:20.500
10 | Sto cercando qualcuno.
11 |
12 | 3
13 | 00:00:36.850 --> 00:00:39.750
14 | Una ricerca pericolosa
15 | per una cacciatrice solitaria.
16 |
17 | 4
18 | 00:00:40.950 --> 00:00:43.870
19 | Sono stata sola per
20 | quanto possa ricordare.
21 |
22 |
--------------------------------------------------------------------------------
/demo/media/sintel/sintel-trailer_nl.vtt:
--------------------------------------------------------------------------------
1 | WEBVTT
2 |
3 | 1
4 | 00:00:11.400 --> 00:00:15.800
5 | Wat brengt je naar het land van de poortwachters?
6 |
7 | 2
8 | 00:00:18.000 --> 00:00:20.500
9 | Ik ben op zoek naar iemand.
10 |
11 | 3
12 | 00:00:36.850 --> 00:00:39.750
13 | Een gevaarlijke queeste voor een eenzame jager.
14 |
15 | 4
16 | 00:00:40.950 --> 00:00:43.870
17 | Ik ben alleen, al zo lang als ik me herinner.
18 |
19 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "jme",
3 | "version": "2.0.8",
4 | "devDependencies": {
5 | "grunt": "~0.4.1",
6 | "grunt-contrib-watch": ">=0.3.0",
7 | "grunt-contrib-concat": ">=0.1.3",
8 | "grunt-contrib-uglify": ">=0.1.1"
9 | }
10 | }
--------------------------------------------------------------------------------
/src/jme.embed.js:
--------------------------------------------------------------------------------
1 | /*
2 | *
3 | * $('.mediaplayer').jmeProp('embedUrl');
4 | *
5 | * $('.mediaplayer').jmeFn('getIframe');
6 | * $('.mediaplayer').jmeFn('getIframe', 600, 300);
7 | * $('.mediaplayer').jmeFn('getIframe', '80%');
8 | */
9 | (function($){
10 | var r20 = /%20/g;
11 | var embedURL;
12 |
13 | if($('html').hasClass('jme-embedded-player')){
14 | var cfg;
15 | var path = (location.search || '').replace(/^\?/, '').split('&');
16 | $.each(path, function(i, part){
17 | part = part.split('=');
18 | if(part[0] == 'jmeembed'){
19 | cfg = part[1];
20 | return false;
21 | }
22 | });
23 | if(cfg){
24 | cfg = decodeURIComponent(cfg.replace(/\+/g, ' '));
25 | try {
26 | cfg = JSON.parse(cfg);
27 | } catch(er){}
28 | if(typeof cfg == 'object' && cfg.e){
29 | if(cfg.a.title){
30 | document.title = cfg.a.title;
31 | }
32 | $(function(){
33 | var player = $('
').prependTo('body').data('jme', {controlbar: true});
34 | if(cfg.e == 'video'){
35 | cfg.a.preload = 'none';
36 | }
37 | if(!$.jme){
38 | cfg.a.controls = 'controls';
39 | }
40 | var media = $(document.createElement(cfg.e)).attr(cfg.a).appendTo(player);
41 |
42 | if(cfg.e == 'video'){
43 | media.css({width: '100%', height: '100%'});
44 | }
45 | $.each(cfg.c, function(i, child){
46 | $(document.createElement(child.e)).attr(child.a).appendTo(media);
47 | });
48 | $('body').updatePolyfill();
49 | media.mediaLoad();
50 | });
51 | }
52 | }
53 | }
54 | (function (factory) {
55 | if($.jme){
56 | factory($);
57 | } else {
58 | $(window).on('jmepluginready', function(){
59 | factory($);
60 | });
61 | }
62 |
63 | }(function($){
64 | var createEmbedUrl = function(){
65 | if(!createEmbedUrl.run){
66 | if($.jme.options.embeddedPlayer){
67 | embedURL = $.jme.options.embeddedPlayer;
68 | }
69 | if(embedURL){
70 | embedURL += (embedURL.indexOf('?') != -1) ? '&' : '?';
71 |
72 | } else if(window.console) {
73 | console.log('you need to define a path to the embedded player $.jme.options.embeddedPlayer');
74 | }
75 | }
76 | createEmbedUrl.run = true;
77 | };
78 |
79 | $.jme.defineMethod('getIframe', function(width, height){
80 | if(!width){
81 | width = 640;
82 | }
83 | if(!height){
84 | height = 360;
85 | }
86 | if(/\d$/.test(''+width)){
87 | width += 'px';
88 | }
89 | if(/\d$/.test(''+height)){
90 | height += 'px';
91 | }
92 | var style = 'width: '+width +'; height: '+ height +'; overflow: hidden; border: none;';
93 | return '';
94 | });
95 |
96 | $.jme.defineProp('embedUrl', {
97 | get: function(elem){
98 | createEmbedUrl();
99 | var data = $.jme.data(elem);
100 | var src = data.media.prop('src');
101 | var obj = {a: {}, c:[]};
102 |
103 | data.media.each(function(){
104 | obj.e = data.media.prop('nodeName').toLowerCase();
105 |
106 | $.each(['poster', 'src', 'autoplay', 'loop', 'muted', 'title'], function(i, attr){
107 | var val = data.media.attr(attr);
108 | if(val != null){
109 | obj.a[attr] = data.media.prop(attr);
110 | }
111 | });
112 | $('track', data.media).each(function(){
113 | var track = $(this);
114 | var child = {e: 'track', a: {}};
115 | obj.c.push(child);
116 | $.each(['src', 'srclang', 'kind', 'label'], function(i, attr){
117 | var val = track.attr(attr);
118 | if(val != null){
119 | child.a[attr] = track.prop(attr);
120 | }
121 | });
122 | });
123 | $('source', data.media).each(function(){
124 | var source = $(this);
125 | var child = {e: 'source', a: {}};
126 | obj.c.push(child);
127 | $.each(['src', 'media', 'type'], function(i, attr){
128 | var val = source.attr(attr);
129 | if(val != null){
130 | child.a[attr] = source.prop(attr);
131 | }
132 | });
133 | });
134 | });
135 |
136 | return embedURL + 'jmeembed=' + encodeURIComponent(JSON.stringify(obj)).replace( r20, "+" );
137 | },
138 | readonly: true
139 | });
140 |
141 | }));
142 | })(window.webshims && webshims.$ || jQuery);
143 |
144 |
--------------------------------------------------------------------------------
/src/jme.fullscreen.js:
--------------------------------------------------------------------------------
1 | (function (factory) {
2 | var $ = window.webshims && webshims.$ || jQuery;
3 | if($.jme){
4 | factory($);
5 | } else {
6 | $(window).on('jmepluginready', function(){
7 | factory($);
8 | });
9 | }
10 |
11 | }(function($){
12 | var btnStructure = '{%text%} ';
13 | var pseudoClasses = 'pseudoClasses';
14 |
15 | //taken from http://johndyer.name/native-fullscreen-javascript-api-plus-jquery-plugin/
16 | $.jme.fullscreen = (function() {
17 | var parentData;
18 | var frameData;
19 | var doc = document.documentElement;
20 |
21 | var fullScreenApi = {
22 | supportsFullScreen: Modernizr.prefixed('fullscreenEnabled', document, false) || Modernizr.prefixed('fullScreenEnabled', document, false),
23 | isFullScreen: function() { return false; },
24 | requestFullScreen: function(elem){
25 | var tmpData;
26 | parentData = [];
27 | $(elem).parentsUntil('body').each(function(){
28 | var pos = $.css(this, 'position');
29 | var left = this.scrollLeft;
30 | var top = this.scrollTop;
31 | var changed;
32 | tmpData = {elemStyle: this.style, elem: this};
33 | if(pos !== 'static'){
34 | changed = true;
35 | tmpData.pos = tmpData.elemStyle.position;
36 | this.style.position = 'static';
37 | }
38 | if(left){
39 | changed = true;
40 | tmpData.left = left;
41 | }
42 | if(top){
43 | changed = true;
44 | tmpData.top = top;
45 | }
46 | if(changed){
47 | parentData.push(tmpData);
48 | }
49 | });
50 | frameData = false;
51 | try {
52 | frameData = {elemStyle: frameElement.style, elem: frameElement, css: {}};
53 | frameData.css.position = frameData.elemStyle.position;
54 | frameData.elemStyle.position = 'fixed';
55 | $.each(['top', 'left', 'right', 'bottom'], function(i, name){
56 | frameData.css[name] = frameData.elemStyle[name];
57 | frameData.elemStyle[name] = '0px';
58 | });
59 | $.each(['height', 'width'], function(i, name){
60 | frameData.css[name] = frameData.elemStyle[name];
61 | frameData.elemStyle[name] = '100%';
62 | });
63 | } catch(er){
64 | frameData = false;
65 | }
66 |
67 | tmpData = null;
68 | },
69 | cancelFullScreen: function(){
70 | if(parentData){
71 | $.each(parentData, function(i, data){
72 | if('pos' in data){
73 | data.elemStyle.position = data.pos;
74 | }
75 | if(data.left){
76 | data.elem.scrollLeft = data.left;
77 | }
78 | if(data.top){
79 | data.elem.scrollTop = data.top;
80 | }
81 | data = null;
82 | });
83 | parentData = [];
84 | }
85 | if(frameData){
86 | $.each(frameData.css, function(name, value){
87 | frameData.elemStyle[name] = value;
88 | });
89 | frameData = false;
90 | }
91 | },
92 | eventName: 'fullscreenchange',
93 | exitName: 'exitFullscreen',
94 | requestName: 'requestFullscreen',
95 | elementName: 'fullscreenElement',
96 | enabledName: ''
97 | };
98 |
99 | fullScreenApi.cancelFullWindow = fullScreenApi.cancelFullScreen;
100 | fullScreenApi.requestFullWindow = fullScreenApi.requestFullScreen;
101 |
102 | // update methods to do something useful
103 | if (fullScreenApi.supportsFullScreen) {
104 | fullScreenApi.enabledName = fullScreenApi.supportsFullScreen;
105 | fullScreenApi.exitName = Modernizr.prefixed("exitFullscreen", document, false) || Modernizr.prefixed("cancelFullScreen", document, false);
106 | fullScreenApi.elementName = Modernizr.prefixed("fullscreenElement", document, false) || Modernizr.prefixed("fullScreenElement", document, false);
107 | fullScreenApi.supportsFullScreen = !!fullScreenApi.supportsFullScreen;
108 | if(fullScreenApi.elementName != 'fullscreenElement' || fullScreenApi.exitName != 'exitFullscreen' || fullScreenApi.enabledName != 'fullscreenEnabled'){
109 | $.each(Modernizr._domPrefixes, function(i, prefix){
110 | var requestName = prefix+'RequestFullscreen';
111 | if((requestName in doc) || ((requestName = prefix+'RequestFullScreen') && (requestName in doc))){
112 | fullScreenApi.eventName = prefix + 'fullscreenchange';
113 | fullScreenApi.requestName = requestName;
114 | return false;
115 | }
116 | });
117 | }
118 |
119 | fullScreenApi.isFullScreen = function() {
120 | return document[fullScreenApi.elementName];
121 | };
122 | fullScreenApi.requestFullScreen = function(el) {
123 | return el[fullScreenApi.requestName]();
124 | };
125 | fullScreenApi.cancelFullScreen = function() {
126 | return document[fullScreenApi.exitName]();
127 | };
128 | }
129 |
130 | if(!window.Modernizr || !('fullscreen' in Modernizr)){
131 | $('html').addClass(fullScreenApi.supportsFullScreen ? 'fullscreen' : 'no-fullscreen');
132 | }
133 |
134 | if(window.parent != window){
135 | (function(){
136 | try{
137 | var frame = window.frameElement;
138 | var fStyle = frame.style;
139 | if (fullScreenApi.supportsFullScreen) {
140 | if('allowfullscreen' in frame && !frame.allowfullscreen) {
141 | frame.allowfullscreen = true;
142 | } else {
143 | if(frame.getAttribute('webkitallowfullscreen') == null){
144 | frame.setAttribute('webkitallowfullscreen', '');
145 | }
146 | if(frame.getAttribute('allowfullscreen') == null){
147 | frame.setAttribute('allowfullscreen', 'allowfullscreen');
148 | }
149 | }
150 | }
151 | } catch(er){
152 | if(!fullScreenApi.supportsFullScreen){
153 | $('html').addClass('no-fullwindow');
154 | }
155 | }
156 | })();
157 |
158 | }
159 |
160 |
161 | return fullScreenApi;
162 | })();
163 |
164 | $.jme.defineProp('fullscreen', {
165 | set: function(elem, value){
166 | var data = $.jme.data(elem);
167 |
168 | if((!data || !data.player) && !$(elem).hasClass($.jme.classNS+'player-fullscreen')){return 'noDataSet';}
169 | if(value){
170 | if(data.player.hasClass($.jme.classNS+'player-fullscreen')){return 'noDataSet';}
171 |
172 | data.scrollPos = {
173 | top: $(window).scrollTop(),
174 | left: $(window).scrollLeft()
175 | };
176 |
177 | $(document)
178 | .unbind('.jmefullscreen')
179 | .bind('keydown.jmefullscreen', function(e){
180 | if(e.keyCode == 27){
181 | data.player.jmeProp('fullscreen', false);
182 | return false;
183 | }
184 | if(e.keyCode === 32 && !('form' in e.target)){
185 | data.media.jmeFn('togglePlay');
186 | return false;
187 | }
188 | })
189 | ;
190 |
191 |
192 | if(value == 'fullwindow'){
193 | $.jme.fullscreen.requestFullWindow(data.player[0]);
194 | } else {
195 | try {
196 | $.jme.fullscreen.requestFullScreen(data.player[0]);
197 | } catch(er){}
198 | }
199 |
200 |
201 | $('html').addClass($.jme.classNS+'has-media-fullscreen');
202 |
203 | data.player.addClass($.jme.classNS+'player-fullscreen');
204 |
205 | data.media.addClass($.jme.classNS+'media-fullscreen');
206 |
207 | $('.jme-default-control-bar', data.player).focus();
208 |
209 | if($.jme.fullscreen.supportsFullScreen){
210 | $(document)
211 | .bind($.jme.fullscreen.eventName+'.jmefullscreen', function(e){
212 | var fullScreenElem = $.jme.fullscreen.isFullScreen();
213 | if(fullScreenElem && elem == fullScreenElem){
214 | $(elem).triggerHandler('playerdimensionchange', ['fullscreen']);
215 | } else {
216 | data.player.jmeProp('fullscreen', false);
217 | }
218 | })
219 | ;
220 |
221 | }
222 | data.player.triggerHandler('playerdimensionchange', ['fullwindow']);
223 |
224 | } else {
225 | if(data.player && !data.player.hasClass($.jme.classNS+'player-fullscreen')){return 'noDataSet';}
226 | $(document).unbind('.jmefullscreen');
227 | $('html').removeClass($.jme.classNS+'has-media-fullscreen');
228 | if(data.player && data.media){
229 | data.player.removeClass($.jme.classNS+'player-fullscreen');
230 | data.media.removeClass($.jme.classNS+'media-fullscreen');
231 | }
232 | if($.jme.fullscreen.isFullScreen()){
233 | try {
234 | $.jme.fullscreen.cancelFullScreen();
235 | } catch(er){}
236 | } else {
237 | $.jme.fullscreen.cancelFullWindow();
238 | }
239 |
240 | if(data.player){
241 | data.player.triggerHandler('playerdimensionchange');
242 | }
243 | if(data.scrollPos){
244 | $(window).scrollTop(data.scrollPos.top);
245 | $(window).scrollLeft(data.scrollPos.left);
246 | delete data.scrollPos;
247 | }
248 | }
249 | return 'noDataSet';
250 | },
251 | get: function(elem){
252 | var data = $.jme.data(elem);
253 | if(!data || !data.player){return;}
254 | var fs = data.player.hasClass($.jme.classNS+'player-fullscreen');
255 | if(!fs){return false;}
256 | return $.jme.fullscreen.isFullScreen() || 'fullwindow';
257 | }
258 | });
259 |
260 | $.jme.defineProp('autoplayfs');
261 |
262 | $.jme.registerPlugin('fullscreen', {
263 | pseudoClasses: {
264 | enter: 'state-enterfullscreen',
265 | exit: 'state-exitfullscreen'
266 | },
267 | options: {
268 | fullscreen: true,
269 | autoplayfs: false
270 | },
271 | structure: btnStructure,
272 | text: 'enter fullscreen / exit fullscreen',
273 | _create: function(control, media, base){
274 | var textFn = $.jme.getButtonText(control, [this[pseudoClasses].enter, this[pseudoClasses].exit]);
275 | var updateControl = function(){
276 | textFn(base.hasClass($.jme.classNS+'player-fullscreen') ? 1 : 0);
277 | };
278 | var options = this.options;
279 | var addDoubbleClick = function(){
280 | $(base.data('jme').controlElements)
281 | .filter('.jme-default-media-overlay')
282 | .off('.dblfullscreen')
283 | .on('dblclick.dblfullscreen', function(e){
284 | base.jmeProp('fullscreen', !base.jmeProp('fullscreen'));
285 | })
286 | ;
287 | };
288 |
289 | base.on('controlsadded', addDoubbleClick);
290 |
291 | base.bind('playerdimensionchange', updateControl);
292 |
293 | control.bind((control.is('select')) ? 'change' : 'click', function(){
294 | var value = base.hasClass($.jme.classNS+'player-fullscreen') ? false : options.fullscreen;
295 | base.jmeProp('fullscreen', value);
296 | if(value && options.autoplayfs){
297 | media.jmeFn('play');
298 | }
299 | });
300 | addDoubbleClick();
301 | updateControl();
302 | }
303 | });
304 | }));
305 |
--------------------------------------------------------------------------------
/src/jme.playlist.js:
--------------------------------------------------------------------------------
1 | (function (factory) {
2 | var $ = window.webshims && webshims.$ || jQuery;
3 | if($.jme){
4 | factory($);
5 | } else {
6 | $(window).on('jmepluginready', function(){
7 | factory($);
8 | });
9 | }
10 |
11 | }(function($){
12 | var multiple = {
13 | contentURL: 1
14 | };
15 | var shemaData = {
16 | image: 'poster',
17 | thumbnail: 'poster',
18 | contentURL: 'srces',
19 | name: 'name',
20 | description: 'description'
21 | };
22 | var mediaProps = {
23 | poster: 1,
24 | srces: 1
25 | };
26 | var itemsSel = '[itemprop="video"], [itemprop="audio"], [itemprop="tracks"]';
27 | var getMediaInfo = function(){
28 | var elem = $(this);
29 | return elem.attr('content') || elem.attr('href') || elem.attr('src') || elem.text() || "";
30 | };
31 |
32 | $.jme.getMediaInfo = function(elem){
33 | elem = $(elem);
34 | var info = {
35 | media: {}
36 | };
37 | $.each(shemaData, function(name, value){
38 | var extData = (mediaProps[value]) ? info.media : info;
39 | if(!extData[value]){
40 | var item = $('[itemprop="'+ name +'"]', elem);
41 | if(multiple[name]){
42 | extData[value] = item.map(getMediaInfo).get();
43 | } else {
44 | extData[value] = getMediaInfo.call(item);
45 | }
46 | }
47 | });
48 | return info;
49 | };
50 |
51 | $.jme.defineProp('selectedItem', {
52 | get: function(elem){
53 | var data = $.jme.data(elem);
54 | var selectItem = data.selectedIndex;
55 | var items;
56 | if(!data.selectedItem){
57 | items = $(itemsSel, elem);
58 | if(typeof data.selectedIndex !== 'number') {
59 | data.selectedItem = items.filter('.selected-item');
60 | data.selectedIndex = items.index(data.selectedItem);
61 | } else {
62 | data.selectedItem = items.eq(data.selectedIndex);
63 | }
64 |
65 | }
66 | return [data.selectedItem, data.selectedIndex];
67 | },
68 | set: function(elem, item){
69 | var data = $.jme.data(elem);
70 | var items = $(itemsSel, elem);
71 | var newItem = (typeof item == 'number') ? items.eq(item) : $(item);
72 | if(newItem && newItem[0]){
73 | data.selectedIndex = (typeof item == 'number') ? item : items.index(newItem[0]);
74 | data.selectedItem = newItem;
75 | items.removeClass('selected-item');
76 | data.selectedItem.addClass('selected-item');
77 | data.mediaInfo = $.jme.getMediaInfo(newItem);
78 | data.media.jmeProp(data.mediaInfo.media);
79 | }
80 | return 'noDataSet';
81 | }
82 | });
83 |
84 | $.jme.registerPlugin('playlist', {
85 | pseudoClasses: {
86 | active: 'active-playlist'
87 | },
88 | options: {
89 | loop: false,
90 | autoplay: false,
91 | selectedIndex: false,
92 | selectedItem: false
93 | },
94 | structure: '',
95 | _create: function(control, media, base, opts){
96 |
97 | this._getSelectedItem(control, media, base, opts);
98 | $(media).bind('ended', function(){
99 | if(opts.autoplay){
100 | var items = $(itemsSel, control);
101 | var selectedItem = control;
102 | }
103 | });
104 | $(control).delegate(itemsSel, 'click', function(){
105 | control.jmeProp('selectedItem', this);
106 | media.play();
107 | return false;
108 | });
109 | },
110 | _getSelectedItem: function(control, media, base, opts){
111 | console.log(control.jmeProp('selectedItem'));
112 | }
113 | });
114 | }));
115 |
--------------------------------------------------------------------------------
/src/jme.track.js:
--------------------------------------------------------------------------------
1 | (function (factory) {
2 | var $ = window.webshims && webshims.$ || jQuery;
3 | if($.jme){
4 | factory($);
5 | } else {
6 | $(window).on('jmepluginready', function(){
7 | factory($);
8 | });
9 | }
10 |
11 | }(function($){
12 | var btnStructure = '{%text%} ';
13 | var pseudoClasses = 'pseudoClasses';
14 | /**
15 | * Added captions Plugin
16 | * @author mderting
17 | */
18 |
19 | $.jme.ButtonMenu = function(button, menu, clickHandler){
20 |
21 | this.button = $(button).attr({'aria-haspopup': 'true'});
22 |
23 | this.clickHandler = clickHandler;
24 |
25 | this.toggle = $.proxy(this, 'toggle');
26 | this.keyIndex = $.proxy(this, 'keyIndex');
27 | this._buttonClick = $.proxy(this, '_buttonClick');
28 |
29 |
30 | this.addMenu(menu);
31 | this._closeFocusOut();
32 | this.button.bind('click', this.toggle);
33 |
34 | };
35 |
36 | $.jme.ButtonMenu.prototype = {
37 | addMenu: function(menu){
38 | if(this.menu){
39 | this.menu.remove();
40 | }
41 | this.menu = $(menu);
42 | this.buttons = $('button', this.menu);
43 | this.menu.insertAfter(this.button);
44 | this.menu
45 | .bind('keydown', this.keyIndex)
46 | .delegate('button', 'click', this._buttonClick)
47 | ;
48 | },
49 | _closeFocusOut: function(){
50 | var that = this;
51 | var timer;
52 | var stopFocusOut = function(){
53 | clearTimeout(timer);
54 | setTimeout(function(){
55 | clearTimeout(timer);
56 | }, 9);
57 | };
58 | this.menu
59 | .parent()
60 | .on('focusin', stopFocusOut)
61 | .on('mousedown', stopFocusOut)
62 | .on('focusout', function(e){
63 | timer = setTimeout(function(){
64 | that.hide();
65 | }, 40);
66 | })
67 | ;
68 | },
69 | _buttonClick: function(e){
70 | this.clickHandler(this.buttons.index(e.currentTarget), e.currentTarget);
71 | this.hide();
72 | },
73 | keyIndex: function(e){
74 | var dir = (e.keyCode == 40) ? 1 : (e.keyCode == 38) ? -1 : 0;
75 | if(dir){
76 | var buttons = this.buttons.not(':disabled');
77 | var activeButton = buttons.filter(':focus');
78 |
79 | activeButton = buttons[buttons.index(activeButton) + dir] || buttons.filter(dir > 0 ? ':first' : ':last');
80 | activeButton.focus();
81 | e.preventDefault();
82 | }
83 | },
84 | show: function(){
85 | if(this.isVisible){return;}
86 | var buttons = this.buttons.not(':disabled');
87 | this.isVisible = true;
88 | this.menu.addClass('visible-menu');
89 | try {
90 | this.activeElement = document.activeElement || this.button[0];
91 | } catch(er){
92 | this.activeElement = this.button[0];
93 | }
94 |
95 | setTimeout(function(){
96 | $(buttons.filter('[aria-checked="true"]')[0] || buttons[0]).focus();
97 | }, 60);
98 | },
99 | toggle: function(){
100 | this[this.isVisible ? 'hide' : 'show']();
101 | },
102 | hide: function(){
103 | if(!this.isVisible){return;}
104 | this.isVisible = false;
105 | this.menu.removeClass('visible-menu');
106 | if(this.activeElement){
107 | try {
108 | this.activeElement.focus();
109 | } catch(er){}
110 | }
111 | this.activeElement = false;
112 | }
113 | };
114 |
115 | var showKinds = {subtitles: 1, caption: 1};
116 | var getTrackMenu = function(tracks){
117 | var items = $.map(tracks, function(track){
118 | var className = (track.kind == 'caption') ? 'caption-type' : 'subtitle-type';
119 | var lang = track.language;
120 | lang = (lang) ? ' '+ lang +' ' : '';
121 | return ''+ track.label + lang +' ';
122 | })
123 | ;
124 | return '';
125 | };
126 |
127 |
128 | $.jme.registerPlugin('captions', {
129 | pseudoClasses: {
130 | enabled: 'state-captionsenabled',
131 | disabled: 'state-captionsdisabled',
132 | noTrack: 'no-track',
133 | hasTrack: 'has-track',
134 | menu: 'subtitle-menu'
135 | },
136 | structure: btnStructure,
137 | text: 'subtitles menu',
138 | _create: function(control, media, base, options){
139 | var that = this;
140 |
141 | var trackElems = media.find('track');
142 | var checkbox = $(control).clone().attr({role: 'checkbox'}).insertBefore(control);
143 |
144 | var btnTextElem = $('span.jme-text, +label span.jme-text', control);
145 |
146 | if(!btnTextElem[0]){
147 | btnTextElem = control;
148 | }
149 |
150 | btnTextElem.html(that.text);
151 |
152 | if(!trackElems.length){
153 | control.prop('disabled', true);
154 | base.addClass(that[pseudoClasses].noTrack);
155 | } else {
156 | base.addClass(that[pseudoClasses].hasTrack);
157 | }
158 |
159 | base.attr('data-tracks', trackElems.length);
160 |
161 | webshims.ready('track', function(){
162 | var menuObj, throttledUpdateMode;
163 | var tracks = [];
164 | var textTracks = media.prop('textTracks');
165 |
166 | var throttledUpdate = (function(){
167 | var timer;
168 | var triggerTimer;
169 | return function(e){
170 | clearTimeout(timer);
171 | clearTimeout(triggerTimer);
172 | if(e.type == 'updatesubtitlestate'){
173 | triggerTimer = setTimeout(function(){
174 | media.trigger('updatetracklist');
175 | }, 0);
176 | }
177 | timer = setTimeout(updateTrackMenu, 19);
178 | };
179 | })();
180 |
181 | function createSubtitleMenu(menu){
182 | var menuClick;
183 |
184 | if(!menuObj){
185 | menuClick = function(index, button){
186 | if($.attr(button, 'aria-checked') == 'true'){
187 | tracks[index].mode = 'disabled';
188 | } else {
189 | $.each(tracks, function(i, track){
190 | track.mode = (i == index) ? 'showing' : 'disabled';
191 | });
192 | }
193 | media.prop('textTracks');
194 | updateMode();
195 | };
196 |
197 | menuObj = new $.jme.ButtonMenu(control, menu, menuClick);
198 | checkbox.on('click', function(){
199 | menuClick(0, this);
200 | return false;
201 | });
202 | } else {
203 | menuObj.addMenu(menu);
204 | }
205 |
206 | updateMode();
207 | }
208 |
209 | function updateMode(){
210 | $('button', menuObj.menu).each(function(i){
211 | var checked = (tracks[i].mode == 'showing') ? 'true' : 'false';
212 | if(!i){
213 | checkbox.attr('aria-checked', checked);
214 | }
215 | $.attr(this, 'aria-checked', checked);
216 | });
217 | }
218 |
219 | function updateTrackMenu(){
220 | tracks = [];
221 | $.each(textTracks, function(i, track){
222 | if(showKinds[track.kind] && track.readyState != 3){
223 | tracks.push(track);
224 | }
225 | });
226 |
227 | base.attr('data-tracks', tracks.length);
228 |
229 | if(tracks.length){
230 | createSubtitleMenu('');
231 |
232 | $('span.jme-text, +label span.jme-text', checkbox).text((tracks[0].label || ' ') + (tracks[0].lang || ''));
233 |
234 | if(!base.hasClass(that[pseudoClasses].hasTrack) || base.hasClass(that[pseudoClasses].noTrack)){
235 | control.prop('disabled', false);
236 | base
237 | .addClass(that[pseudoClasses].hasTrack)
238 | .removeClass(that[pseudoClasses].noTrack)
239 | .triggerHandler('controlschanged')
240 | ;
241 | }
242 |
243 | } else if(!base.hasClass(that[pseudoClasses].noTrack) || base.hasClass(that[pseudoClasses].hasTrack)){
244 | control.prop('disabled', true);
245 | base
246 | .addClass(that[pseudoClasses].noTrack)
247 | .removeClass(that[pseudoClasses].hasTrack)
248 | .triggerHandler('controlschanged')
249 | ;
250 | }
251 | }
252 |
253 | if(!textTracks){
254 | textTracks = [];
255 | updateTrackMenu();
256 | } else {
257 | throttledUpdateMode = (function(){
258 | var timer;
259 | return function(){
260 | clearTimeout(timer);
261 | timer = setTimeout(updateMode, 20);
262 | };
263 | })();
264 |
265 | updateTrackMenu();
266 |
267 | $([textTracks])
268 | .on('addtrack removetrack', throttledUpdate)
269 | .on('change', throttledUpdateMode)
270 | ;
271 |
272 | base.on('updatesubtitlestate', throttledUpdate);
273 | media.on('updatetrackdisplay', throttledUpdateMode);
274 | }
275 |
276 | });
277 |
278 | }
279 |
280 | });
281 | }));
282 |
--------------------------------------------------------------------------------