From 694430f542b5ac940d19b7601827d517499406c3 Mon Sep 17 00:00:00 2001 From: drigato Date: Thu, 12 Mar 2015 15:45:53 -0400 Subject: [PATCH] SAAS-637: Un-hardcode all player variables --- .../controllers/EmbeddableplayerController.php | 9 +++++++++ .../application/forms/EmbeddablePlayer.php | 18 +++++++++++------- .../scripts/embeddableplayer/embed-code.phtml | 8 ++++---- .../views/scripts/form/embeddableplayer.phtml | 2 +- 4 files changed, 25 insertions(+), 12 deletions(-) diff --git a/airtime_mvc/application/controllers/EmbeddableplayerController.php b/airtime_mvc/application/controllers/EmbeddableplayerController.php index 6fc2d9e13..fa37e2861 100644 --- a/airtime_mvc/application/controllers/EmbeddableplayerController.php +++ b/airtime_mvc/application/controllers/EmbeddableplayerController.php @@ -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'); } } \ No newline at end of file diff --git a/airtime_mvc/application/forms/EmbeddablePlayer.php b/airtime_mvc/application/forms/EmbeddablePlayer.php index 230037de7..7a89660ff 100644 --- a/airtime_mvc/application/forms/EmbeddablePlayer.php +++ b/airtime_mvc/application/forms/EmbeddablePlayer.php @@ -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(''); - $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(''); + $embedSrc->removeDecorator('label'); + $this->addElement($embedSrc); + } } \ No newline at end of file diff --git a/airtime_mvc/application/views/scripts/embeddableplayer/embed-code.phtml b/airtime_mvc/application/views/scripts/embeddableplayer/embed-code.phtml index 74da31357..73db907b7 100644 --- a/airtime_mvc/application/views/scripts/embeddableplayer/embed-code.phtml +++ b/airtime_mvc/application/views/scripts/embeddableplayer/embed-code.phtml @@ -2,17 +2,17 @@ - + - + - + - + \ No newline at end of file diff --git a/airtime_mvc/application/views/scripts/form/embeddableplayer.phtml b/airtime_mvc/application/views/scripts/form/embeddableplayer.phtml index 568540d7f..d4f481199 100644 --- a/airtime_mvc/application/views/scripts/form/embeddableplayer.phtml +++ b/airtime_mvc/application/views/scripts/form/embeddableplayer.phtml @@ -8,6 +8,6 @@ element->getElement('player_stream_url'); ?>
- + element->getElement('player_embed_src')->getValue(); ?> \ No newline at end of file