Committing lots of trial and error embed player code changes

This commit is contained in:
drigato 2015-03-18 14:23:38 -04:00
parent 1f2f8a27a5
commit ed891fb145
8 changed files with 107 additions and 17 deletions

View File

@ -12,6 +12,10 @@ class EmbeddablePlayerController extends Zend_Controller_Action
$CC_CONFIG = Config::getConfig();
$baseUrl = Application_Common_OsPath::getBaseDir();
$this->view->headLink()->appendStylesheet($baseUrl.'css/embeddableplayer.css?'.$CC_CONFIG['airtime_version']);
$this->view->headScript()->appendFile($baseUrl.'js/airtime/embeddableplayer/mrp.js?'.$CC_CONFIG['airtime_version']);
$this->view->headScript()->appendFile($baseUrl.'js/airtime/embeddableplayer/embeddableplayer.js?'.$CC_CONFIG['airtime_version']);
$form = new Application_Form_EmbeddablePlayer();
if ($form->getElement('player_stream_url')->getAttrib('numberOfEnabledStreams') > 0) {
@ -28,11 +32,13 @@ class EmbeddablePlayerController extends Zend_Controller_Action
$request = $this->getRequest();
$this->view->mrp_js = Application_Common_HTTPHelper::getStationUrl() . "/js/airtime/embeddableplayer/mrp.js";
$this->view->muses_swf = Application_Common_HTTPHelper::getStationUrl() . "/js/airtime/embeddableplayer/muses.swf";
$this->view->skin = Application_Common_HTTPHelper::getStationUrl() . "/js/airtime/embeddableplayer/ffmp3-mcclean.xml";
$this->view->mrp_js = Application_Common_HTTPHelper::getStationUrl() . "js/airtime/embeddableplayer/mrp.js";
$this->view->muses_swf = Application_Common_HTTPHelper::getStationUrl() . "js/airtime/embeddableplayer/muses.swf";
$this->view->skin = Application_Common_HTTPHelper::getStationUrl() . "js/airtime/embeddableplayer/ffmp3-mcclean.xml";
$this->view->codec = $request->getParam('codec');
$this->view->streamURL = $request->getParam('url');
//$this->view->streamURL = $request->getParam('url');
//$stream = $request->getParam('stream');
$this->view->streamURL = "http://127.0.0.1:8000/airtime_128";
$this->view->displayMetadata = $request->getParam('display_metadata');
}
}

View File

@ -22,6 +22,7 @@ class Application_Form_EmbeddablePlayer extends Zend_Form_SubForm
$streamURL->setMultiOptions(
$urlOptions
);
Logging::info($urlOptions);
$streamURL->setValue(array_keys($urlOptions)[0]);
$streamURL->setLabel(_('Select stream:'));
$streamURL->setAttrib('codec', array_values($urlOptions)[0]);
@ -33,8 +34,9 @@ class Application_Form_EmbeddablePlayer extends Zend_Form_SubForm
$embedSrc = new Zend_Form_Element_Text('player_embed_src');
$embedSrc->setAttrib("readonly", "readonly");
$embedSrc->setValue('<iframe frameborder="0" src="'.Application_Common_HTTPHelper::getStationUrl().'/embeddableplayer/embed-code?url='.$url.'&codec='.$codec.'"></iframe>');
$embedSrc->setAttrib("class", "embed-player-text-box");
//$embedSrc->setValue('<iframe frameborder="0" src="'.Application_Common_HTTPHelper::getStationUrl().'embeddableplayer/embed-code?url='.$url.'&codec='.$codec.'"></iframe>');
$embedSrc->setValue('<iframe frameborder="0" src="'.Application_Common_HTTPHelper::getStationUrl().'embeddableplayer/embed-code?stream=stream1&codec='.$codec.'"></iframe>');
$embedSrc->removeDecorator('label');
$this->addElement($embedSrc);

View File

@ -3,16 +3,33 @@
<head>
<script src="<?php echo $this->mrp_js?>" type="text/javascript"></script>
<script type="text/javascript">
function musesCallback(event,value){
if (event == "source") {
//MRP.setUrl("http://sourcefabric.out.airtime.pro:8000/sourcefabric_b");
}
}
</script>
</head>
<body>
<object classid="" width="180" height="60" bgcolor="#FFFFFF">
<param name="movie" value="muses.swf" />
<param name="flashvars" value="url=<?php echo $this->streamURL?>&lang=auto&codec=<?php echo $this->codec?>&volume=100&introurl=&tracking=true&jsevents=true&buffering=5&skin=<?php echo $this->skin?>&title=''" />
<param name="wmode" value="window" />
<param name="allowscriptaccess" value="always" />
<param name="bgcolor" value="#FFFFFF" />
<param name="scale" value="noscale" />
<embed src="<?php echo $this->muses_swf?>" flashvars="url=<?php echo $this->streamURL?>&lang=auto&codec=<?php echo $this->codec?>&volume=100&introurl=&tracking=true&jsevents=true&buffering=5&skin=<?php echo $this->skin?>&title=''" width="180" scale="noscale" height="60" wmode="window" bgcolor="#FFFFFF" allowscriptaccess="always" type="application/x-shockwave-flash" />
</object>
<script type="text/javascript">
MRP.insert({
'url':"<?php echo $this->streamURL ?>",
'codec':"<?php echo $this->codec ?>",
'volume':100,
'jsevents':true,
'autoplay':false,
'buffering':5,
'title':'test',
'bgcolor':'#FFFFFF',
'skin':"<?php echo $this->skin ?>",
'width':180,
'height':60
});
</script>
</body>
</html>

View File

@ -1,9 +1,9 @@
<div class="ui-widget ui-widget-content block-shadow simple-formblock embed-player-form clearfix padded-strong preferences">
<div class="ui-widget ui-widget-content block-shadow simple-formblock embed-player-form clearfix padded-strong ">
<h2 style="float:left"><?php echo _("Embeddable Player") ?></h2>
<?php $baseUrl = Application_Common_OsPath::getBaseDir(); ?>
<form method="post" id="player_form" enctype="multipart/form-data">
<div style="clear:both"></div>
<?php echo $this->errorMsg; ?>
<?php echo $this->form; ?>

View File

@ -8,9 +8,31 @@
<?php echo $this->element->getElement('player_stream_url'); ?>
<?php echo $this->element->getElement('player_preview_label')->renderLabel(); ?>
<div style="clear:both"></div>
<div id="custom_muses_player">
<a href="#"><div id="muses_play">play</div></a>
<a href="#"><div id="muses_stop">stop</div></a>
</div>
<!--
<div style="clear:both"></div>
<object classid="" width="180" height="60" bgcolor="#FFFFFF">
<param name="movie" value="muses.swf" />
<param name="flashvars" value="url=<?php echo $this->streamURL?>&lang=auto&codec=<?php echo $this->codec?>&volume=100&introurl=&tracking=true&jsevents=true&buffering=5&title=''%skin=''" />
<param name="wmode" value="window" />
<param name="allowscriptaccess" value="always" />
<param name="bgcolor" value="#FFFFFF" />
<param name="scale" value="noscale" />
<embed src="<?php echo $this->muses_swf?>" flashvars="url=<?php echo $this->streamURL?>&lang=auto&codec=<?php echo $this->codec?>&volume=100&introurl=&tracking=true&jsevents=true&buffering=5&title=''&skin=''" width="180" scale="noscale" height="60" wmode="window" bgcolor="#FFFFFF" allowscriptaccess="always" type="application/x-shockwave-flash" />
</object>
-->
<div style="clear:both"></div>
<div id="embed_player_preview">
<?php echo $this->element->getElement('player_embed_src')->getValue(); ?>
</div>
</dl>
</fieldset>

View File

@ -0,0 +1,14 @@
.embed-player-text-box {
padding-right: 0px !important;
width: 100% !important;
}
.embed-player-form {
width: 70%;
}
.embed-player-form dd {
width: 100% !important;
float: left;
margin: 0;
padding: 4px 0px 4px 0px;
}

View File

@ -0,0 +1,28 @@
function generateEmbedSrc()
{
document.getElementById('embed_player_preview').textContent="";
}
function setupPlayer()
{
MRP.insert({
'url':"http://127.0.0.1:8000/airtime_128",
'codec':"mp3",
'volume':100,
'jsevents':true,
'autoplay':false,
'buffering':5,
'title':'test',
'bgcolor':'#FFFFFF',
'skin':-1,
'width':180,
'height':60
});
}
window.onload = function() {
setupPlayer();
document.getElementById('player_display_track_metadata').onchange = generateEmbedSrc;
document.getElementById('muses_play').click = MRP.play();
document.getElementById('muses_stop').click = MRP.stop();
}

View File

@ -203,7 +203,8 @@
c + ("&skin=" + g.getSkin(a.skin, !0)),
c = c + ("&title=" + a.title),
c = c + ("&welcome=" + a.welcome),
b = g.getScriptBaseHREF() + "/muses-hosted.swf",
//b = g.getScriptBaseHREF() + "/muses-hosted.swf",
b = "http://localhost/js/airtime/embeddableplayer/muses.swf",
e = 'width="' + a.width + '" height="' + a.height + '" ';
null != a.bgcolor && (e += 'bgcolor="' + a.bgcolor + '" ');
var f = '<object id="' + a.id + '" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ' + e + ">",