SAAS-637: Un-hardcode all player variables

This commit is contained in:
drigato 2015-03-12 15:45:53 -04:00
parent ac2181a52d
commit 694430f542
4 changed files with 25 additions and 12 deletions

View File

@ -17,5 +17,14 @@ class EmbeddablePlayerController extends Zend_Controller_Action
public function embedCodeAction()
{
$this->view->layout()->disableLayout();
$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->codec = $request->getParam('codec');
$this->view->streamURL = $request->getParam('url');
$this->view->displayMetadata = $request->getParam('display_metadata');
}
}

View File

@ -8,12 +8,6 @@ class Application_Form_EmbeddablePlayer extends Zend_Form_SubForm
array('ViewScript', array('viewScript' => 'form/embeddableplayer.phtml'))
));
$embedSrc = new Zend_Form_Element_Text('player_embed_src');
$embedSrc->setAttrib("readonly", "readonly");
$embedSrc->setValue('<iframe frameborder="0" src="http://localhost/embeddableplayer/embed-code"></iframe>');
$embedSrc->removeDecorator('label');
$this->addElement($embedSrc);
$displayTrackMetadata = new Zend_Form_Element_Checkbox('player_display_track_metadata');
$displayTrackMetadata->setValue(true);
$displayTrackMetadata->setLabel(_('Display track metadata?'));
@ -27,9 +21,19 @@ class Application_Form_EmbeddablePlayer extends Zend_Form_SubForm
$streamURL->setMultiOptions(
$urlOptions
);
$streamURL->setValue(0);
$streamURL->setValue(array_keys($urlOptions)[0]);
$streamURL->setLabel(_('Select stream:'));
$streamURL->setAttrib('codec', array_values($urlOptions)[0]);
$this->addElement($streamURL);
$url = $streamURL->getValue();
$codec = $streamURL->getAttrib('codec');
$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->removeDecorator('label');
$this->addElement($embedSrc);
}
}

View File

@ -2,17 +2,17 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script src="http://localhost/widgets/muses/self_hosted/mrp.js" type="text/javascript"></script>
<script src="<?php echo $this->mrp_js?>" type="text/javascript"></script>
</head>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="180" height="60" bgcolor="#FFFFFF">
<object classid="" width="180" height="60" bgcolor="#FFFFFF">
<param name="movie" value="muses.swf" />
<param name="flashvars" value="url=http://albertprov1.out.airtime.pro:8000/albertprov1_a&lang=auto&codec=mp3&volume=100&introurl=&tracking=true&jsevents=true&buffering=5&skin=http://localhost/js/airtime/embeddableplayer/ffmp3-mcclean.xml&title=Albert's%20Test Stream" />
<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="http://localhost/js/airtime/embeddableplayer/muses.swf" flashvars="url=http://albertprov1.out.airtime.pro:8000/albertprov1_a&lang=auto&codec=mp3&volume=100&introurl=&tracking=true&jsevents=true&buffering=5&skin=http://localhost/js/airtime/embeddableplayer/ffmp3-mcclean.xml&title=Albert's%20Test Stream" width="180" scale="noscale" height="60" wmode="window" bgcolor="#FFFFFF" allowscriptaccess="always" type="application/x-shockwave-flash" />
<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>
</html>

View File

@ -8,6 +8,6 @@
<?php echo $this->element->getElement('player_stream_url'); ?>
<div style="clear:both"></div>
<iframe frameborder="0" src="http://localhost/embeddableplayer/embed-code"></iframe>
<?php echo $this->element->getElement('player_embed_src')->getValue(); ?>
</dl>
</fieldset>