forked from BrightcoveOS/Brightcove-Wordpress-Plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbrightcove_shortcode.php
42 lines (33 loc) · 1.25 KB
/
brightcove_shortcode.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
add_shortcode('brightcove','add_brightcove');
function add_brightcove($atts) {
add_brightcove_script();
$html;
$html = '<div style="display:none"></div>
<object id="'.rand().'" class="BrightcoveExperience">
<param name="bgcolor" value="#FFFFFF" />
<param name="wmode" value="transparent" />
<param name="width" value="' . $atts['width'] . '" />
<param name="height" value="'. $atts['height'] .'" />';
if ($atts['playerid'] != NULL) {
$html = $html . '<param name="playerID" value="'.$atts['playerid'].'" />';
}
if ($atts['playerkey'] != NULL) {
$html = $html . '<param name="playerKey" value="'.$atts['playerkey'].'"/>';
}
$html = $html .' <param name="isVid" value="true" />
<param name="isUI" value="true" />
<param name="dynamicStreaming" value="true" />';
if ($atts['videoid'] != NULL)
{
$html = $html . '<param name="@videoPlayer" value="'.$atts['videoid'].'" />';
}
if ($atts['playlistid'] != NULL)
{
$html = $html . '<param name="@playlistTabs" value="'.$atts['playlistid'].'" />';
$html = $html . '<param name="@videoList" value="'.$atts['playlistid'].'" />';
$html = $html . '<param name="@playlistCombo" value="'.$atts['playlistid'].'" />';
}
$html = $html . '</object>';
return $html;
}