Skip to content
This repository was archived by the owner on Aug 9, 2019. It is now read-only.

Commit 944fbd6

Browse files
committedJun 3, 2012
Minor updates
new "skin_height" param; minor bug fixes
1 parent 4bad3aa commit 944fbd6

File tree

5 files changed

+538
-236
lines changed

5 files changed

+538
-236
lines changed
 

‎.gitattributes

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
*.doc diff=astextplain
2+
*.DOC diff=astextplain
3+
*.docx diff=astextplain
4+
*.DOCX diff=astextplain
5+
*.dot diff=astextplain
6+
*.DOT diff=astextplain
7+
*.pdf diff=astextplain
8+
*.PDF diff=astextplain
9+
*.rtf diff=astextplain
10+
*.RTF diff=astextplain
11+
12+
*.jpg binary
13+
*.png binary
14+
*.gif binary
15+
16+
*.cs text=auto diff=csharp
17+
*.vb text=auto
18+
*.c text=auto
19+
*.cpp text=auto
20+
*.cxx text=auto
21+
*.h text=auto
22+
*.hxx text=auto
23+
*.py text=auto
24+
*.rb text=auto
25+
*.java text=auto
26+
*.html text=auto
27+
*.htm text=auto
28+
*.css text=auto
29+
*.scss text=auto
30+
*.sass text=auto
31+
*.less text=auto
32+
*.js text=auto
33+
*.lisp text=auto
34+
*.clj text=auto
35+
*.sql text=auto
36+
*.php text=auto
37+
*.lua text=auto
38+
*.m text=auto
39+
*.asm text=auto
40+
*.erl text=auto
41+
*.fs text=auto
42+
*.fsx text=auto
43+
*.hs text=auto
44+
45+
*.csproj text=auto merge=union
46+
*.vbproj text=auto merge=union
47+
*.fsproj text=auto merge=union
48+
*.dbproj text=auto merge=union
49+
*.sln text=auto eol=crlf merge=union

‎.gitignore

+175
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
2+
#################
3+
## Eclipse
4+
#################
5+
6+
*.pydevproject
7+
.project
8+
.metadata
9+
bin/**
10+
tmp/**
11+
tmp/**/*
12+
*.tmp
13+
*.bak
14+
*.swp
15+
*~.nib
16+
local.properties
17+
.classpath
18+
.settings/
19+
.loadpath
20+
21+
# External tool builders
22+
.externalToolBuilders/
23+
24+
# Locally stored "Eclipse launch configurations"
25+
*.launch
26+
27+
# CDT-specific
28+
.cproject
29+
30+
# PDT-specific
31+
.buildpath
32+
33+
34+
#################
35+
## Visual Studio
36+
#################
37+
38+
## Ignore Visual Studio temporary files, build results, and
39+
## files generated by popular Visual Studio add-ons.
40+
41+
# User-specific files
42+
*.suo
43+
*.user
44+
*.sln.docstates
45+
46+
# Build results
47+
**/[Dd]ebug/
48+
**/[Rr]elease/
49+
*_i.c
50+
*_p.c
51+
*.ilk
52+
*.meta
53+
*.obj
54+
*.pch
55+
*.pdb
56+
*.pgc
57+
*.pgd
58+
*.rsp
59+
*.sbr
60+
*.tlb
61+
*.tli
62+
*.tlh
63+
*.tmp
64+
*.vspscc
65+
.builds
66+
**/*.dotCover
67+
68+
## TODO: If you have NuGet Package Restore enabled, uncomment this
69+
#**/packages/
70+
71+
# Visual C++ cache files
72+
ipch/
73+
*.aps
74+
*.ncb
75+
*.opensdf
76+
*.sdf
77+
78+
# Visual Studio profiler
79+
*.psess
80+
*.vsp
81+
82+
# ReSharper is a .NET coding add-in
83+
_ReSharper*
84+
85+
# Installshield output folder
86+
[Ee]xpress
87+
88+
# DocProject is a documentation generator add-in
89+
DocProject/buildhelp/
90+
DocProject/Help/*.HxT
91+
DocProject/Help/*.HxC
92+
DocProject/Help/*.hhc
93+
DocProject/Help/*.hhk
94+
DocProject/Help/*.hhp
95+
DocProject/Help/Html2
96+
DocProject/Help/html
97+
98+
# Click-Once directory
99+
publish
100+
101+
# Others
102+
[Bb]in
103+
[Oo]bj
104+
sql
105+
TestResults
106+
*.Cache
107+
ClientBin
108+
stylecop.*
109+
~$*
110+
*.dbmdl
111+
Generated_Code #added for RIA/Silverlight projects
112+
113+
# Backup & report files from converting an old project file to a newer
114+
# Visual Studio version. Backup files are not needed, because we have git ;-)
115+
_UpgradeReport_Files/
116+
Backup*/
117+
UpgradeLog*.XML
118+
119+
120+
121+
############
122+
## Windows
123+
############
124+
125+
# Windows image file caches
126+
Thumbs.db
127+
128+
# Folder config file
129+
Desktop.ini
130+
131+
132+
133+
############
134+
## Sublime Text 2
135+
############
136+
137+
# Sublime Text 2 Project files
138+
*.sublime-project
139+
*.sublime-workspace
140+
141+
142+
#############
143+
## Python
144+
#############
145+
146+
*.py[co]
147+
148+
# Packages
149+
*.egg
150+
*.egg-info
151+
dist
152+
build
153+
eggs
154+
parts
155+
bin
156+
var
157+
sdist
158+
develop-eggs
159+
.installed.cfg
160+
161+
# Installer logs
162+
pip-log.txt
163+
164+
# Unit test / coverage reports
165+
.coverage
166+
.tox
167+
168+
#Translations
169+
*.mo
170+
171+
#Mr Developer
172+
.mr.developer.cfg
173+
174+
# Mac crap
175+
.DS_Store

‎EE1/system/plugins/pi.mc_player.php

+96-61
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
/*
55
MC Player Plugin
6-
6+
77
@package ExpressionEngine
88
@subpackage Addons
99
@category Plugin
@@ -39,10 +39,10 @@ function modes
3939
function mode
4040
function config
4141
*/
42-
42+
4343
$plugin_info = array(
4444
'pi_name' => 'MC Player',
45-
'pi_version' => '0.2.5',
45+
'pi_version' => '0.2.6',
4646
'pi_author' => 'Michael C.',
4747
'pi_author_url' => 'http://www.pro-image.co.il/',
4848
'pi_description' => 'An imlementation of the JW HTML5 Media Player',
@@ -77,7 +77,7 @@ function Mc_player()
7777

7878
/**
7979
* Indent
80-
*
80+
*
8181
* Indents lines in a given string by the specified number of levels
8282
*
8383
* @param text String to log
@@ -89,10 +89,10 @@ private function indent($text,$indent_levels = 1)
8989
{
9090
return ( str_replace(PHP_EOL, PHP_EOL . str_repeat("\t", $indent_levels), $text) );
9191
}
92-
92+
9393
/**
9494
* _log_item
95-
*
95+
*
9696
* Write items to template debugging log
9797
*
9898
* @param string String to log
@@ -126,12 +126,12 @@ private function _log_item($string = FALSE, $indent = 1)
126126
* @access private
127127
* @return array
128128
*/
129-
private function calculateSize($native_width, $native_height, $fit_in_width, $controlbar, $pl_position = '', $pl_size = '')
129+
private function calculateSize($native_width, $native_height, $fit_in_width, $controlbar, $pl_position = '', $pl_size = '', $skin_height = 0)
130130
{
131131
$size = array();
132-
133-
$skin_height = 0; // height of skin control interface
134-
if ($controlbar != 'over') { $skin_height = 24; }
132+
133+
// $skin_height = 0; // height of skin control interface
134+
if ($controlbar == 'over') { $skin_height = 0; }
135135

136136
if ($fit_in_width && ($native_height > 0))
137137
{
@@ -147,7 +147,7 @@ private function calculateSize($native_width, $native_height, $fit_in_width, $co
147147
$size['width'] = $native_width;
148148
$size['height'] = $native_height + $skin_height;
149149
}
150-
150+
151151
switch ($pl_position)
152152
{
153153
case "left":
@@ -208,7 +208,7 @@ function play()
208208
/*
209209
Prepare a warning if modes are specified with HTML5 before
210210
flash AND a playlist is specified.
211-
211+
212212
HTML5 mode requires native browser playback support for any
213213
given media format. The player script detects if a browser
214214
supports playback of the specified media file in the
@@ -218,13 +218,13 @@ function play()
218218
will not fall back to Flash mode in that specific instance.
219219
*/
220220
if ( (strpos($modes, 'html5') < strpos($modes, 'flash')) && (isset($playlist['code']) || isset($playlist['params']['file'])) )
221-
{
221+
{
222222
$this->_log_item("WARNING in MC Player plugin: 'html5' mode and a playlist were both specified. Browsers will be unable to play media files they do not natively support. Either prioritize 'flash' over 'html5' modes, or use individual files instead of a playlist to fix the issue.");
223223
}
224224

225225

226226
// Validate parameter values
227-
227+
228228
// Container tag stuff
229229
$player['params']['container_tag'] = ($this->TMPL->fetch_param('container_tag')) ? $this->TMPL->fetch_param('container_tag') : 'div'; // valid values are 'div' (the default), 'video', 'audio', 'span', 'a'
230230
if ($this->TMPL->fetch_param('container_id')) // Use specified ID of container
@@ -339,11 +339,12 @@ function play()
339339
$player['params']['mute'] = ($this->TMPL->fetch_param('mute')) ? $this->TMPL->fetch_param('mute') : '';
340340
$player['params']['volume'] = ($this->TMPL->fetch_param('volume')) ? $this->TMPL->fetch_param('volume') : '80';
341341
$player['params']['showmute'] = ($this->TMPL->fetch_param('showmute')) ? $this->TMPL->fetch_param('showmute') : '';
342-
342+
$player['params']['skin_height'] = ($this->TMPL->fetch_param('skin_height')) ? $this->TMPL->fetch_param('skin_height') : '';
343+
343344
// Playlist stuff
344345
$player['params']['shuffle'] = ($this->TMPL->fetch_param('shuffle')) ? $this->TMPL->fetch_param('shuffle') : '';
345346
$player['params']['repeat'] = ($this->TMPL->fetch_param('repeat')) ? $this->TMPL->fetch_param('repeat') : '';
346-
347+
347348
switch ($player['params']['repeat']) // input value verification
348349
{
349350
case "none":
@@ -359,7 +360,7 @@ function play()
359360
$player['params']['repeat'] = '';
360361
break;
361362
}
362-
363+
363364
// Playlist position
364365
if (isset($this->SESS->cache['mc']['player']['playlist_position']) !== false)
365366
{
@@ -371,8 +372,8 @@ function play()
371372
$playlist['params']['position'] = '';
372373
}
373374
// end playlist position
374-
375-
375+
376+
376377
// Playlist Size
377378
if (isset($this->SESS->cache['mc']['player']['playlist_size']) !== false)
378379
{
@@ -383,7 +384,7 @@ function play()
383384
{
384385
$playlist['params']['size'] = '';
385386
}
386-
387+
387388
// Controlbar
388389
if ($this->TMPL->fetch_param('controlbar') === FALSE AND ($playlist['params']['position'] OR $playlist['params']['size']) AND ( $player['params']['native_height'] == 0 OR ($player['params']['container_tag'] == 'audio' AND $player['params']['native_height'] === FALSE))) // if controlbar is unspecified AND a playlist is showing AND the height would be zero, default the controlbar to top.
389390
{
@@ -408,7 +409,7 @@ function play()
408409
{
409410
$player['params']['controlbar'] = 'over';
410411
}
411-
412+
412413
// Streaming stuff
413414
$player['params']['streamer'] = ($this->TMPL->fetch_param('streamer')) ? $this->TMPL->fetch_param('streamer') : '';
414415
$player['params']['http_startparam'] = ($this->TMPL->fetch_param('http.startparam')) ? $this->TMPL->fetch_param('http.startparam') : '';
@@ -431,9 +432,9 @@ function play()
431432
// ----------------------------------------
432433
// Container code
433434
// ----------------------------------------
434-
435+
435436
$container_params = ' id="' . $player['params']['container_id'] . '" class="' . $player['params']['container_class'] . '"';
436-
437+
437438
// Create the container
438439
switch ($player['params']['container_tag'])
439440
{
@@ -517,18 +518,18 @@ function play()
517518
default:
518519
$this->_log_item("WARNING in MC Player plugin: Specified 'container_tag' is not valid; defaulting to <div>");
519520
$player['params']['container_tag'] = 'div';
520-
521+
521522
case "span":
522523
case "div":
523524
$container = '<' . $player['params']['container_tag'] . $container_params . '>Javascript must be enabled to play this media.</'.$player['params']['container_tag'].'>';
524525
break;
525526
}
526-
527-
527+
528+
528529
// ----------------------------------------
529530
// Player script code
530531
// ----------------------------------------
531-
532+
532533
$script_start = PHP_EOL . "<script type='text/javascript'>";
533534
$script_start .= PHP_EOL . "jwplayer('" . $player['params']['container_id'] . "').setup({";
534535
$script = ($player['params']['playerpath']) ? PHP_EOL . "flashplayer: '" . $player['params']['playerpath'] . "'" . ',' : '';
@@ -553,8 +554,8 @@ function play()
553554
$script_properties['pl_position'] = ($playlist['params']['position']) ? PHP_EOL . "'playlist.position': '" . $playlist['params']['position'] . "'" . ',' : '';
554555
$script_properties['pl_size'] = ($playlist['params']['size']) ? PHP_EOL . "'playlist.size': '" . $playlist['params']['size'] . "'" . ',' : '';
555556
$script_properties['http_startparam'] = ($player['params']['http_startparam']) ? PHP_EOL . "'http.startparam': '" . $player['params']['http_startparam'] . "'" . ',' : '';
556-
557-
557+
558+
558559
// Determine which type of player to create based on which
559560
// variables have been prepared by the other functions
560561
if (isset($playlist['code']) && $playlist['code'] != '')
@@ -582,24 +583,24 @@ function play()
582583
$this->_log_item("ERROR in MC Player plugin: No file, playlist, or levels specified; aborting");
583584
return $this->TMPL->no_results();
584585
}
585-
586+
586587
if ($plugins)
587588
{
588589
// plugins exists
589590
$script .= PHP_EOL . $plugins . ',';
590591
}
591-
592+
592593
if ($modes)
593594
{
594595
// plugins exists
595596
$script .= PHP_EOL . $modes . ',';
596597
}
597-
598+
598599
foreach ($script_properties as $value) // Catch-all
599600
{
600601
$script .= $value;
601602
}
602-
603+
603604
if (isset($player['params']['provider']))
604605
{
605606
switch ($player['params']['provider'])
@@ -618,12 +619,12 @@ function play()
618619
break;
619620
}
620621
}
621-
622+
622623
$script_end = PHP_EOL . "});";
623624
$script_end .= PHP_EOL . "</script>";
624-
625+
625626
return $container . $script_start . $this->indent(trim($script, ',')) . $script_end;
626-
627+
627628

628629
} // END function play()
629630

@@ -639,9 +640,9 @@ function play()
639640
function playlist()
640641
{
641642

642-
643+
643644
$this->SESS->cache['mc']['player']['playlist_file'] = ($this->TMPL->fetch_param('file')) ? $this->TMPL->fetch_param('file') : '';
644-
645+
645646
// Size
646647
if ($this->TMPL->fetch_param('size')) // if something was specified for 'size'...
647648
{
@@ -655,7 +656,7 @@ function playlist()
655656
$this->SESS->cache['mc']['player']['playlist_size'] = 160;
656657
}
657658
}
658-
659+
659660
// Position
660661
if ($this->TMPL->fetch_param('position'))
661662
{
@@ -673,7 +674,7 @@ function playlist()
673674
break;
674675
}
675676
}
676-
677+
677678
// Items
678679
if (isset($this->SESS->cache['mc']['player']['items']) !== FALSE)
679680
{
@@ -722,10 +723,10 @@ function item()
722723
$item['levels'] = '';
723724
}
724725
unset($this->SESS->cache['mc']['player']['levels']);
725-
726+
726727

727728
// Validation & Formatting
728-
729+
729730
// 'file' or 'levels' required
730731
if ($item['levels'])
731732
{
@@ -746,18 +747,18 @@ function item()
746747
$this->_log_item("WARNING in MC Player plugin: No 'file' specified for playlist item; skipping");
747748
return $this->TMPL->no_results();
748749
}
749-
750+
750751
// image
751752
$item['code'] .= ($item['params']['image']) ? PHP_EOL . 'image: "' . $item['params']['image'] . '",' : '';
752-
753+
753754
// 'duration' and 'start' should be integers
754755
if (ctype_digit($item['params']['duration'])) {
755756
$item['code'] .= PHP_EOL . 'duration: ' . $item['params']['duration'] . ',';
756757
} elseif ($item['params']['duration'] != '') {
757758
$this->_log_item("WARNING in MC Player plugin: Specified 'duration' for item is not an integer; ignoring parameter");
758759
unset($item['params']['duration']);
759760
}
760-
761+
761762
if (ctype_digit($item['params']['start'])) {
762763
$item['code'] .= PHP_EOL . 'start: '.$item['params']['start'].',';
763764
} elseif ($item['params']['start'] != '') {
@@ -785,18 +786,18 @@ function item()
785786
unset($item['params']['provider']);
786787
break;
787788
}
788-
789-
790-
789+
790+
791+
791792
$item['code'] = PHP_EOL . "{" . $this->indent(trim($item['code'], ", ")) . PHP_EOL . "},";
792-
793+
793794
// store result in session for use upstream
794795
if (!isset($this->SESS->cache['mc']['player']['items']))
795796
{
796797
$this->SESS->cache['mc']['player']['items'] = '';
797798
}
798799
$this->SESS->cache['mc']['player']['items'] .= $item['code'];
799-
800+
800801
} // END function item()
801802

802803

@@ -852,7 +853,7 @@ function level()
852853
$this->_log_item("WARNING in MC Player plugin: Specified 'bitrate' for level is not an integer; ignoring parameter");
853854
unset($level['params']['bitrate']);
854855
}
855-
856+
856857
if (ctype_digit($level['params']['width']))
857858
{
858859
$level['code']['width'] = 'width: ' . $level['params']['width'] . ', ';
@@ -862,7 +863,7 @@ function level()
862863
$this->_log_item("WARNING in MC Player plugin: Specified 'width' for level is not an integer; ignoring parameter");
863864
unset($level['params']['width']);
864865
}
865-
866+
866867
if ($level['params']['file'])
867868
{
868869
$this->SESS->cache['mc']['player']['id'] .= "_" . basename(html_entity_decode($level['params']['file'])); // used for auto-naming container ID
@@ -921,13 +922,16 @@ function plugin()
921922

922923
if ($plugin_name = $this->TMPL->fetch_param('plugin_name'))
923924
{
925+
// Prepare vars
926+
$this->SESS->cache['mc']['player']['plugin_list'] = '';
927+
924928
// Process each param
925929
$params = '';
926930
foreach ($this->TMPL->tagparams as $pname => $pvalue)
927931
{
928932
if ($pname != "plugin_name") $params .= $pname . ': "' . $pvalue . '", ';
929933
}
930-
934+
931935
// Format params into full plugin line
932936
$plugin = $this->indent(PHP_EOL . $plugin_name . ": { " . trim($params, ', ') . " },");
933937

@@ -977,14 +981,14 @@ function modes()
977981
*/
978982
function mode()
979983
{
980-
984+
981985
// Assignment
982986
$mode['params']['type'] = ($this->TMPL->fetch_param('type')) ? $this->TMPL->fetch_param('type') : '';
983987
$mode['params']['src'] = ($this->TMPL->fetch_param('src')) ? $this->TMPL->fetch_param('src') : '';
984-
985-
988+
989+
986990
// $mode['code']['params'] = '';
987-
991+
988992
switch ($mode['params']['type'])
989993
{
990994
case 'flash':
@@ -998,24 +1002,24 @@ function mode()
9981002
$this->_log_item("ERROR in MC Player plugin: No 'src' specified for 'flash' mode; skipping current mode");
9991003
}
10001004
break;
1001-
1005+
10021006
case 'html5':
10031007
case 'download':
10041008
$mode['code']['params'] = PHP_EOL . 'type: "' . $mode['params']['type'] . '", ';
10051009
break;
1006-
1010+
10071011
default:
10081012
$this->_log_item("ERROR in MC Player plugin: No 'type' specified for mode; skipping current mode");
10091013
break;
10101014
}
1011-
1015+
10121016
// Include alternate config if specified
10131017
if (isset($this->SESS->cache['mc']['player']['mode']['config']) !== FALSE)
10141018
{
10151019
$mode['code']['params'] = PHP_EOL . "config: {" . trim($this->SESS->cache['mc']['player']['mode']['config'], ",") . PHP_EOL . "}";
10161020
unset($this->SESS->cache['mc']['player']['mode']['config']);
10171021
}
1018-
1022+
10191023
// Format params into full plugin line
10201024
$mode['code']['output'] = $this->indent(PHP_EOL . "{ " . $this->indent(trim($mode['code']['params'], ', ')) . PHP_EOL . "},");
10211025
// store result in session for use upstream
@@ -1161,6 +1165,21 @@ function usage()
11611165
{/exp:mc_player:play}
11621166

11631167

1168+
File with skin & plugin
1169+
-----------------------
1170+
1171+
{exp:mc_player:play width="480" height="270" file="vid_480.mp4" skin="/path/to/skin.zip" skin_height="42" controlbar="bottom"}
1172+
{exp:mc_player:plugins}
1173+
{exp:mc_player:plugin plugin_name="hd" file="vid_720.mp4" fullscreen="true"}
1174+
{exp:mc_player:plugin plugin_name="gapro" accountid="UKsi93X940-24"}
1175+
{/exp:mc_player:plugins}
1176+
{/exp:mc_player:play}
1177+
1178+
NOTES:
1179+
{exp:mc_player:play} - The "skin_height" parameter can be added when the controlbar is "top" or "bottom" and the skin's controlbar height differs from the default skin's height of 24 pixels.
1180+
{exp:mc_player:plugin} - Any parameters specified will be passed along as-is; only the "plugin_name" parameter is required.
1181+
1182+
11641183
JS playlist with files & levels
11651184
-------------------------------
11661185

@@ -1194,6 +1213,22 @@ function usage()
11941213
----- level
11951214
--- item 4
11961215

1216+
1217+
Parameters (WIP)
1218+
================
1219+
1220+
{exp:mc_player:play}
1221+
--------------------
1222+
1223+
- skin_height = $pixels_integer // default = 0
1224+
Used when specifying a custom player skin that has a controlbar whose height is different than the 24 pixels of the default skin. Only useful when the controlbar param is set to "top" or "bottom".
1225+
1226+
{exp:mc_player:plugin}
1227+
--------------------
1228+
1229+
- plugin_name = $string
1230+
The name of the plugin
1231+
11971232
<?php
11981233
$buffer = ob_get_contents();
11991234
ob_end_clean();

‎EE2/system/expressionengine/third_party/mc_player/pi.mc_player.php

+97-62
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
/*
55
MC Player Plugin
6-
6+
77
@package ExpressionEngine
88
@subpackage Addons
99
@category Plugin
@@ -39,10 +39,10 @@ function modes
3939
function mode
4040
function config
4141
*/
42-
42+
4343
$plugin_info = array(
4444
'pi_name' => 'MC Player',
45-
'pi_version' => '0.2.5',
45+
'pi_version' => '0.2.6',
4646
'pi_author' => 'Michael C.',
4747
'pi_author_url' => 'http://www.pro-image.co.il/',
4848
'pi_description' => 'An imlementation of the JW HTML5 Media Player',
@@ -77,7 +77,7 @@ public function __construct()
7777

7878
/**
7979
* Indent
80-
*
80+
*
8181
* Indents lines in a given string by the specified number of levels
8282
*
8383
* @param text String to log
@@ -89,10 +89,10 @@ private function indent($text,$indent_levels = 1)
8989
{
9090
return ( str_replace(PHP_EOL, PHP_EOL . str_repeat("\t", $indent_levels), $text) );
9191
}
92-
92+
9393
/**
9494
* _log_item
95-
*
95+
*
9696
* Write items to template debugging log
9797
*
9898
* @param string String to log
@@ -126,12 +126,12 @@ private function _log_item($string = FALSE, $indent = 1)
126126
* @access private
127127
* @return array
128128
*/
129-
private function calculateSize($native_width, $native_height, $fit_in_width, $controlbar, $pl_position = '', $pl_size = '')
129+
private function calculateSize($native_width, $native_height, $fit_in_width, $controlbar, $pl_position = '', $pl_size = '', $skin_height = 0)
130130
{
131131
$size = array();
132-
133-
$skin_height = 0; // height of skin control interface
134-
if ($controlbar != 'over') { $skin_height = 24; }
132+
133+
// $skin_height = 0; // height of skin control interface
134+
if ($controlbar == 'over') { $skin_height = 0; }
135135

136136
if ($fit_in_width && ($native_height > 0))
137137
{
@@ -147,7 +147,7 @@ private function calculateSize($native_width, $native_height, $fit_in_width, $co
147147
$size['width'] = $native_width;
148148
$size['height'] = $native_height + $skin_height;
149149
}
150-
150+
151151
switch ($pl_position)
152152
{
153153
case "left":
@@ -208,7 +208,7 @@ function play()
208208
/*
209209
Prepare a warning if modes are specified with HTML5 before
210210
flash AND a playlist is specified.
211-
211+
212212
HTML5 mode requires native browser playback support for any
213213
given media format. The player script detects if a browser
214214
supports playback of the specified media file in the
@@ -218,13 +218,13 @@ function play()
218218
will not fall back to Flash mode in that specific instance.
219219
*/
220220
if ( (strpos($modes, 'html5') < strpos($modes, 'flash')) && (isset($playlist['code']) || isset($playlist['params']['file'])) )
221-
{
221+
{
222222
$this->_log_item("WARNING in MC Player plugin: 'html5' mode and a playlist were both specified. Browsers will be unable to play media files they do not natively support. Either prioritize 'flash' over 'html5' modes, or use individual files instead of a playlist to fix the issue.");
223223
}
224224

225225

226226
// Validate parameter values
227-
227+
228228
// Container tag stuff
229229
$player['params']['container_tag'] = $this->TMPL->fetch_param('container_tag', 'div'); // valid values are 'div' (the default), 'video', 'audio', 'span', 'a'
230230
if ($this->TMPL->fetch_param('container_id')) // Use specified ID of container
@@ -339,11 +339,12 @@ function play()
339339
$player['params']['mute'] = $this->TMPL->fetch_param('mute');
340340
$player['params']['volume'] = $this->TMPL->fetch_param('volume', '80');
341341
$player['params']['showmute'] = $this->TMPL->fetch_param('showmute');
342-
342+
$player['params']['skin_height'] = $this->TMPL->fetch_param('skin_height');
343+
343344
// Playlist stuff
344345
$player['params']['shuffle'] = $this->TMPL->fetch_param('shuffle');
345346
$player['params']['repeat'] = $this->TMPL->fetch_param('repeat');
346-
347+
347348
switch ($player['params']['repeat']) // input value verification
348349
{
349350
case "none":
@@ -359,7 +360,7 @@ function play()
359360
$player['params']['repeat'] = '';
360361
break;
361362
}
362-
363+
363364
// Playlist position
364365
if (isset($this->SESS->cache['mc']['player']['playlist_position']) !== false)
365366
{
@@ -371,8 +372,8 @@ function play()
371372
$playlist['params']['position'] = '';
372373
}
373374
// end playlist position
374-
375-
375+
376+
376377
// Playlist Size
377378
if (isset($this->SESS->cache['mc']['player']['playlist_size']) !== false)
378379
{
@@ -383,7 +384,7 @@ function play()
383384
{
384385
$playlist['params']['size'] = '';
385386
}
386-
387+
387388
// Controlbar
388389
if ($this->TMPL->fetch_param('controlbar') === FALSE AND ($playlist['params']['position'] OR $playlist['params']['size']) AND ( $player['params']['native_height'] == 0 OR ($player['params']['container_tag'] == 'audio' AND $player['params']['native_height'] === FALSE))) // if controlbar is unspecified AND a playlist is showing AND the height would be zero, default the controlbar to top.
389390
{
@@ -408,7 +409,7 @@ function play()
408409
{
409410
$player['params']['controlbar'] = 'over';
410411
}
411-
412+
412413
// Streaming stuff
413414
$player['params']['streamer'] = $this->TMPL->fetch_param('streamer');
414415
$player['params']['http_startparam'] = $this->TMPL->fetch_param('http.startparam');
@@ -426,14 +427,14 @@ function play()
426427
break;
427428
}
428429

429-
$player['size'] = $this->calculateSize($player['params']['native_width'], $player['params']['native_height'], $player['params']['fit_in_width'], $player['params']['controlbar'], $playlist['params']['position'], $playlist['params']['size']);
430+
$player['size'] = $this->calculateSize($player['params']['native_width'], $player['params']['native_height'], $player['params']['fit_in_width'], $player['params']['controlbar'], $playlist['params']['position'], $playlist['params']['size'], $player['params']['skin_height']);
430431

431432
// ----------------------------------------
432433
// Container code
433434
// ----------------------------------------
434-
435+
435436
$container_params = ' id="' . $player['params']['container_id'] . '" class="' . $player['params']['container_class'] . '"';
436-
437+
437438
// Create the container
438439
switch ($player['params']['container_tag'])
439440
{
@@ -517,18 +518,18 @@ function play()
517518
default:
518519
$this->_log_item("WARNING in MC Player plugin: Specified 'container_tag' is not valid; defaulting to <div>");
519520
$player['params']['container_tag'] = 'div';
520-
521+
521522
case "span":
522523
case "div":
523524
$container = '<' . $player['params']['container_tag'] . $container_params . '>Javascript must be enabled to play this media.</'.$player['params']['container_tag'].'>';
524525
break;
525526
}
526-
527-
527+
528+
528529
// ----------------------------------------
529530
// Player script code
530531
// ----------------------------------------
531-
532+
532533
$script_start = PHP_EOL . "<script type='text/javascript'>";
533534
$script_start .= PHP_EOL . "jwplayer('" . $player['params']['container_id'] . "').setup({";
534535
$script = ($player['params']['playerpath']) ? PHP_EOL . "flashplayer: '" . $player['params']['playerpath'] . "'" . ',' : '';
@@ -553,8 +554,8 @@ function play()
553554
$script_properties['pl_position'] = ($playlist['params']['position']) ? PHP_EOL . "'playlist.position': '" . $playlist['params']['position'] . "'" . ',' : '';
554555
$script_properties['pl_size'] = ($playlist['params']['size']) ? PHP_EOL . "'playlist.size': '" . $playlist['params']['size'] . "'" . ',' : '';
555556
$script_properties['http_startparam'] = ($player['params']['http_startparam']) ? PHP_EOL . "'http.startparam': '" . $player['params']['http_startparam'] . "'" . ',' : '';
556-
557-
557+
558+
558559
// Determine which type of player to create based on which
559560
// variables have been prepared by the other functions
560561
if (isset($playlist['code']) && $playlist['code'] != '')
@@ -582,24 +583,24 @@ function play()
582583
$this->_log_item("ERROR in MC Player plugin: No file, playlist, or levels specified; aborting");
583584
return $this->TMPL->no_results();
584585
}
585-
586+
586587
if ($plugins)
587588
{
588589
// plugins exists
589590
$script .= PHP_EOL . $plugins . ',';
590591
}
591-
592+
592593
if ($modes)
593594
{
594595
// plugins exists
595596
$script .= PHP_EOL . $modes . ',';
596597
}
597-
598+
598599
foreach ($script_properties as $value) // Catch-all
599600
{
600601
$script .= $value;
601602
}
602-
603+
603604
if (isset($player['params']['provider']))
604605
{
605606
switch ($player['params']['provider'])
@@ -618,12 +619,12 @@ function play()
618619
break;
619620
}
620621
}
621-
622+
622623
$script_end = PHP_EOL . "});";
623624
$script_end .= PHP_EOL . "</script>";
624-
625+
625626
return $container . $script_start . $this->indent(trim($script, ',')) . $script_end;
626-
627+
627628

628629
} // END function play()
629630

@@ -639,9 +640,9 @@ function play()
639640
function playlist()
640641
{
641642

642-
643+
643644
$this->SESS->cache['mc']['player']['playlist_file'] = ($this->TMPL->fetch_param('file')) ? $this->TMPL->fetch_param('file') : '';
644-
645+
645646
// Size
646647
if ($this->TMPL->fetch_param('size')) // if something was specified for 'size'...
647648
{
@@ -655,7 +656,7 @@ function playlist()
655656
$this->SESS->cache['mc']['player']['playlist_size'] = 160;
656657
}
657658
}
658-
659+
659660
// Position
660661
if ($this->TMPL->fetch_param('position'))
661662
{
@@ -673,7 +674,7 @@ function playlist()
673674
break;
674675
}
675676
}
676-
677+
677678
// Items
678679
if (isset($this->SESS->cache['mc']['player']['items']) !== FALSE)
679680
{
@@ -722,10 +723,10 @@ function item()
722723
$item['levels'] = '';
723724
}
724725
unset($this->SESS->cache['mc']['player']['levels']);
725-
726+
726727

727728
// Validation & Formatting
728-
729+
729730
// 'file' or 'levels' required
730731
if ($item['levels'])
731732
{
@@ -746,18 +747,18 @@ function item()
746747
$this->_log_item("WARNING in MC Player plugin: No 'file' specified for playlist item; skipping");
747748
return $this->TMPL->no_results();
748749
}
749-
750+
750751
// image
751752
$item['code'] .= ($item['params']['image']) ? PHP_EOL . 'image: "' . $item['params']['image'] . '",' : '';
752-
753+
753754
// 'duration' and 'start' should be integers
754755
if (ctype_digit($item['params']['duration'])) {
755756
$item['code'] .= PHP_EOL . 'duration: ' . $item['params']['duration'] . ',';
756757
} elseif ($item['params']['duration'] != '') {
757758
$this->_log_item("WARNING in MC Player plugin: Specified 'duration' for item is not an integer; ignoring parameter");
758759
unset($item['params']['duration']);
759760
}
760-
761+
761762
if (ctype_digit($item['params']['start'])) {
762763
$item['code'] .= PHP_EOL . 'start: '.$item['params']['start'].',';
763764
} elseif ($item['params']['start'] != '') {
@@ -785,18 +786,18 @@ function item()
785786
unset($item['params']['provider']);
786787
break;
787788
}
788-
789-
790-
789+
790+
791+
791792
$item['code'] = PHP_EOL . "{" . $this->indent(trim($item['code'], ", ")) . PHP_EOL . "},";
792-
793+
793794
// store result in session for use upstream
794795
if (!isset($this->SESS->cache['mc']['player']['items']))
795796
{
796797
$this->SESS->cache['mc']['player']['items'] = '';
797798
}
798799
$this->SESS->cache['mc']['player']['items'] .= $item['code'];
799-
800+
800801
} // END function item()
801802

802803

@@ -852,7 +853,7 @@ function level()
852853
$this->_log_item("WARNING in MC Player plugin: Specified 'bitrate' for level is not an integer; ignoring parameter");
853854
unset($level['params']['bitrate']);
854855
}
855-
856+
856857
if (ctype_digit($level['params']['width']))
857858
{
858859
$level['code']['width'] = 'width: ' . $level['params']['width'] . ', ';
@@ -862,7 +863,7 @@ function level()
862863
$this->_log_item("WARNING in MC Player plugin: Specified 'width' for level is not an integer; ignoring parameter");
863864
unset($level['params']['width']);
864865
}
865-
866+
866867
if ($level['params']['file'])
867868
{
868869
$this->SESS->cache['mc']['player']['id'] .= "_" . basename(html_entity_decode($level['params']['file'])); // used for auto-naming container ID
@@ -921,13 +922,16 @@ function plugin()
921922

922923
if ($plugin_name = $this->TMPL->fetch_param('plugin_name'))
923924
{
925+
// Prepare vars
926+
$this->SESS->cache['mc']['player']['plugin_list'] = '';
927+
924928
// Process each param
925929
$params = '';
926930
foreach ($this->TMPL->tagparams as $pname => $pvalue)
927931
{
928932
if ($pname != "plugin_name") $params .= $pname . ': "' . $pvalue . '", ';
929933
}
930-
934+
931935
// Format params into full plugin line
932936
$plugin = $this->indent(PHP_EOL . $plugin_name . ": { " . trim($params, ', ') . " },");
933937

@@ -977,14 +981,14 @@ function modes()
977981
*/
978982
function mode()
979983
{
980-
984+
981985
// Assignment
982986
$mode['params']['type'] = $this->TMPL->fetch_param('type');
983987
$mode['params']['src'] = $this->TMPL->fetch_param('src');
984-
985-
988+
989+
986990
// $mode['code']['params'] = '';
987-
991+
988992
switch ($mode['params']['type'])
989993
{
990994
case 'flash':
@@ -998,24 +1002,24 @@ function mode()
9981002
$this->_log_item("ERROR in MC Player plugin: No 'src' specified for 'flash' mode; skipping current mode");
9991003
}
10001004
break;
1001-
1005+
10021006
case 'html5':
10031007
case 'download':
10041008
$mode['code']['params'] = PHP_EOL . 'type: "' . $mode['params']['type'] . '", ';
10051009
break;
1006-
1010+
10071011
default:
10081012
$this->_log_item("ERROR in MC Player plugin: No 'type' specified for mode; skipping current mode");
10091013
break;
10101014
}
1011-
1015+
10121016
// Include alternate config if specified
10131017
if (isset($this->SESS->cache['mc']['player']['mode']['config']) !== FALSE)
10141018
{
10151019
$mode['code']['params'] = PHP_EOL . "config: {" . trim($this->SESS->cache['mc']['player']['mode']['config'], ",") . PHP_EOL . "}";
10161020
unset($this->SESS->cache['mc']['player']['mode']['config']);
10171021
}
1018-
1022+
10191023
// Format params into full plugin line
10201024
$mode['code']['output'] = $this->indent(PHP_EOL . "{ " . $this->indent(trim($mode['code']['params'], ', ')) . PHP_EOL . "},");
10211025
// store result in session for use upstream
@@ -1161,6 +1165,21 @@ public static function usage()
11611165
{/exp:mc_player:play}
11621166

11631167

1168+
File with skin & plugin
1169+
-----------------------
1170+
1171+
{exp:mc_player:play width="480" height="270" file="vid_480.mp4" skin="/path/to/skin.zip" skin_height="42" controlbar="bottom"}
1172+
{exp:mc_player:plugins}
1173+
{exp:mc_player:plugin plugin_name="hd" file="vid_720.mp4" fullscreen="true"}
1174+
{exp:mc_player:plugin plugin_name="gapro" accountid="UKsi93X940-24"}
1175+
{/exp:mc_player:plugins}
1176+
{/exp:mc_player:play}
1177+
1178+
NOTES:
1179+
{exp:mc_player:play} - The "skin_height" parameter can be added when the controlbar is "top" or "bottom" and the skin's controlbar height differs from the default skin's height of 24 pixels.
1180+
{exp:mc_player:plugin} - Any parameters specified will be passed along as-is; only the "plugin_name" parameter is required.
1181+
1182+
11641183
JS playlist with files & levels
11651184
-------------------------------
11661185

@@ -1194,6 +1213,22 @@ public static function usage()
11941213
----- level
11951214
--- item 4
11961215

1216+
1217+
Parameters (WIP)
1218+
================
1219+
1220+
{exp:mc_player:play}
1221+
--------------------
1222+
1223+
- skin_height = $pixels_integer // default = 0
1224+
Used when specifying a custom player skin that has a controlbar whose height is different than the 24 pixels of the default skin. Only useful when the controlbar param is set to "top" or "bottom".
1225+
1226+
{exp:mc_player:plugin}
1227+
--------------------
1228+
1229+
- plugin_name = $string
1230+
The name of the plugin
1231+
11971232
<?php
11981233
$buffer = ob_get_contents();
11991234
ob_end_clean();

‎README.md

+121-113
Original file line numberDiff line numberDiff line change
@@ -1,114 +1,122 @@
1-
Changelog
2-
=========
3-
- 0.2.5 (2012-03-19):
4-
- Abstracted much of the EE1/EE2 plugin code for improved maintainability
5-
- Changed default player 'container_tag' from <video> to <div> due to the <video> tag's lack of playlist support
6-
- Included additional debug log messages under various situations
7-
- Bug fixes
8-
- 0.2.4 (2012-03-13):
9-
- Made controlbar/playlist positioning smarter by default
10-
- Bug fixes
11-
- 0.2.3 (2012-02-05):
12-
- Fixed a bunch of "undeclared variable" PHP notifications again
13-
- Changed how external playlists work (now uses an extra {exp:mc_player:playlist file="playlist.xml"} tag inside the existing {exp:mc_player:play} tags)
14-
- Changed default video size from 300x150 to 480x270
15-
- Renamed most internal variables for consistency
16-
- 0.2.2 (2011-11-23):
17-
- Changed plugin file encoding from "UTF-8" to "UTF-8 without BOM" (suspected as causing "Headers already sent" PHP errors)
18-
- Forgot to increment the internal version number in the previous update. :p
19-
- 0.2.1 (2011-11-22):
20-
- Minor change to prevent some PHP Notice messages when pl_size & pl_position parameters are not provided
21-
- Began this changelog
22-
23-
24-
Examples
25-
========
26-
27-
Single file
28-
-----------
29-
30-
### Video
31-
{exp:mc_player:play file="video.mp4" width="480" height="270" playerpath="/path/to/player.swf"}
32-
33-
### Audio
34-
{exp:mc_player:play file="audio.mp3" width="480" playerpath="/path/to/player.swf"
35-
container_tag="audio"}
36-
37-
Note: The JW Player does not yet support the HTML 5 `<audio>` tag; in this case, the `<video>` tag will be used.
38-
39-
40-
Playlists
41-
---------
42-
43-
### XML/RSS
44-
{exp:mc_player:play width="480" height="270" playerpath="/path/to/player.swf"}
45-
{exp:mc_player:playlist file="playlist.xml" position="right" size="360"}
46-
{/exp:mc_player:play}
47-
48-
### Javascript
49-
{exp:mc_player:play width="480" height="270" playerpath="/path/to/player.swf"}
50-
{exp:mc_player:playlist position="bottom" size="240"}
51-
{exp:mc_player:item file="entry_1.mp4" image="entry_1.jpg" duration="54" title="First item"}
52-
{exp:mc_player:item file="entry_2.mp4"}
53-
{exp:mc_player:item file="entry_3.mp4"}
54-
{/exp:mc_player:playlist}
55-
{/exp:mc_player:play}
56-
57-
58-
File with levels
59-
----------------
60-
61-
{exp:mc_player:play width="480" height="270" playerpath="/path/to/player.swf"
62-
provider="http" http.startparam="starttime"}
63-
{exp:mc_player:levels}
64-
{exp:mc_player:level bitrate="300" file="vid_320.mp4" width="320"}
65-
{exp:mc_player:level bitrate="600" file="vid_480.mp4" width="480"}
66-
{exp:mc_player:level bitrate="900" file="vid_720.mp4" width="720"}
67-
{/exp:mc_player:levels}
68-
{/exp:mc_player:play}
69-
70-
71-
File with modes
72-
---------------
73-
74-
{exp:mc_player:play width="480" height="270" file="vid_480.mp4"}
75-
{exp:mc_player:modes}
76-
{exp:mc_player:mode type="html5"}
77-
{exp:mc_player:mode type="flash" src="/path/to/player.swf"}
78-
{exp:mc_player:mode type="download"}
79-
{/exp:mc_player:modes}
80-
{/exp:mc_player:play}
81-
82-
83-
JS playlist with files & levels
84-
-------------------------------
85-
86-
{exp:mc_player:play width="320" height="240"}
87-
{exp:mc_player:playlist position="right" size="360"}
88-
{exp:mc_player:item file="entry_1.mp4" image="entry_1.jpg" duration="54"}{/exp:mc_player:item}
89-
{exp:mc_player:item file="entry_2.mp4" image="entry_2.jpg" duration="42"}{/exp:mc_player:item}
90-
{exp:mc_player:item}
91-
{exp:mc_player:levels}
92-
{exp:mc_player:level bitrate="300" file="entry_1_320.mp4" width="320"}
93-
{exp:mc_player:level bitrate="600" file="entry_1_480.mp4" width="480"}
94-
{exp:mc_player:level bitrate="900" file="entry_1_720.mp4" width="720"}
95-
{/exp:mc_player:levels}
96-
{/exp:mc_player:item}
97-
{exp:mc_player:item file="entry_3.mp4" image="entry_3.jpg" duration="564"}{/exp:mc_player:item}
98-
{/exp:mc_player:playlist}
99-
{/exp:mc_player:play}
100-
101-
Please note: if any tag is used as a tag pair instead of a single tag, all tags of that specific type must also be pairs (in this case, the `exp:mc_player:item` tag pairs)
102-
103-
A simple view of the heirarchy for the above code could be:
104-
105-
- player
106-
-- playlist
107-
--- item 1
108-
--- item 2
109-
--- item 3
110-
---- levels
111-
----- level
112-
----- level
113-
----- level
1+
Plugin: MC Player
2+
=================
3+
An implementation of the JW HTML5 Media Player as an ExpressionEngine plugin.
4+
5+
6+
Changelog
7+
=========
8+
- 0.2.6 (2012-06-03):
9+
- Added skin_height parameter
10+
- Minor bug fixes
11+
- 0.2.5 (2012-03-19):
12+
- Abstracted much of the EE1/EE2 plugin code for improved maintainability
13+
- Changed default player 'container_tag' from <video> to <div> due to the <video> tag's lack of playlist support
14+
- Included additional debug log messages under various situations
15+
- Bug fixes
16+
- 0.2.4 (2012-03-13):
17+
- Made controlbar/playlist positioning smarter by default
18+
- Bug fixes
19+
- 0.2.3 (2012-02-05):
20+
- Fixed a bunch of "undeclared variable" PHP notifications again
21+
- Changed how external playlists work (now uses an extra {exp:mc_player:playlist file="playlist.xml"} tag inside the existing {exp:mc_player:play} tags)
22+
- Changed default video size from 300x150 to 480x270
23+
- Renamed most internal variables for consistency
24+
- 0.2.2 (2011-11-23):
25+
- Changed plugin file encoding from "UTF-8" to "UTF-8 without BOM" (suspected as causing "Headers already sent" PHP errors)
26+
- Forgot to increment the internal version number in the previous update. :p
27+
- 0.2.1 (2011-11-22):
28+
- Minor change to prevent some PHP Notice messages when pl_size & pl_position parameters are not provided
29+
- Began this changelog
30+
31+
32+
Examples
33+
========
34+
35+
Single file
36+
-----------
37+
38+
### Video
39+
{exp:mc_player:play file="video.mp4" width="480" height="270" playerpath="/path/to/player.swf"}
40+
41+
### Audio
42+
{exp:mc_player:play file="audio.mp3" width="480" playerpath="/path/to/player.swf"
43+
container_tag="audio"}
44+
45+
Note: The JW Player does not yet support the HTML 5 `<audio>` tag; in this case, the `<video>` tag will be used.
46+
47+
48+
Playlists
49+
---------
50+
51+
### XML/RSS
52+
{exp:mc_player:play width="480" height="270" playerpath="/path/to/player.swf"}
53+
{exp:mc_player:playlist file="playlist.xml" position="right" size="360"}
54+
{/exp:mc_player:play}
55+
56+
### Javascript
57+
{exp:mc_player:play width="480" height="270" playerpath="/path/to/player.swf"}
58+
{exp:mc_player:playlist position="bottom" size="240"}
59+
{exp:mc_player:item file="entry_1.mp4" image="entry_1.jpg" duration="54" title="First item"}
60+
{exp:mc_player:item file="entry_2.mp4"}
61+
{exp:mc_player:item file="entry_3.mp4"}
62+
{/exp:mc_player:playlist}
63+
{/exp:mc_player:play}
64+
65+
66+
File with levels
67+
----------------
68+
69+
{exp:mc_player:play width="480" height="270" playerpath="/path/to/player.swf"
70+
provider="http" http.startparam="starttime"}
71+
{exp:mc_player:levels}
72+
{exp:mc_player:level bitrate="300" file="vid_320.mp4" width="320"}
73+
{exp:mc_player:level bitrate="600" file="vid_480.mp4" width="480"}
74+
{exp:mc_player:level bitrate="900" file="vid_720.mp4" width="720"}
75+
{/exp:mc_player:levels}
76+
{/exp:mc_player:play}
77+
78+
79+
File with modes
80+
---------------
81+
82+
{exp:mc_player:play width="480" height="270" file="vid_480.mp4"}
83+
{exp:mc_player:modes}
84+
{exp:mc_player:mode type="html5"}
85+
{exp:mc_player:mode type="flash" src="/path/to/player.swf"}
86+
{exp:mc_player:mode type="download"}
87+
{/exp:mc_player:modes}
88+
{/exp:mc_player:play}
89+
90+
91+
JS playlist with files & levels
92+
-------------------------------
93+
94+
{exp:mc_player:play width="320" height="240"}
95+
{exp:mc_player:playlist position="right" size="360"}
96+
{exp:mc_player:item file="entry_1.mp4" image="entry_1.jpg" duration="54"}{/exp:mc_player:item}
97+
{exp:mc_player:item file="entry_2.mp4" image="entry_2.jpg" duration="42"}{/exp:mc_player:item}
98+
{exp:mc_player:item}
99+
{exp:mc_player:levels}
100+
{exp:mc_player:level bitrate="300" file="entry_1_320.mp4" width="320"}
101+
{exp:mc_player:level bitrate="600" file="entry_1_480.mp4" width="480"}
102+
{exp:mc_player:level bitrate="900" file="entry_1_720.mp4" width="720"}
103+
{/exp:mc_player:levels}
104+
{/exp:mc_player:item}
105+
{exp:mc_player:item file="entry_3.mp4" image="entry_3.jpg" duration="564"}{/exp:mc_player:item}
106+
{/exp:mc_player:playlist}
107+
{/exp:mc_player:play}
108+
109+
Please note: if any tag is used as a tag pair instead of a single tag, all tags of that specific type must also be pairs (in this case, the `exp:mc_player:item` tag pairs)
110+
111+
A simple view of the heirarchy for the above code could be:
112+
113+
- player
114+
-- playlist
115+
--- item 1
116+
--- item 2
117+
--- item 3
118+
---- levels
119+
----- level
120+
----- level
121+
----- level
114122
--- item 4

0 commit comments

Comments
 (0)
This repository has been archived.