Ejemplo n.º 1
0
 /**
  * @param CM_Model_Stream_Abstract $stream
  */
 public function removeStream(CM_Model_Stream_Abstract $stream)
 {
     $streamChannel = $stream->getStreamChannel();
     $stream->delete();
     if (!$streamChannel->hasStreams()) {
         $streamChannel->delete();
     }
 }
Ejemplo n.º 2
0
 /**
  * @param CM_Model_Stream_Abstract $stream
  * @throws CM_Exception_Invalid
  */
 public function stopStream(CM_Model_Stream_Abstract $stream)
 {
     /** @var CM_Model_StreamChannel_Video $streamChannel */
     $streamChannel = $stream->getStreamChannel();
     if (!$streamChannel instanceof CM_Model_StreamChannel_Video) {
         throw new CM_Exception_Invalid('Cannot stop stream of non-video channel');
     }
     $this->_stopStream($stream);
 }
Ejemplo n.º 3
0
 protected function _getContainingCacheables()
 {
     $cacheables = parent::_getContainingCacheables();
     $cacheables[] = $this->getStreamChannel()->getStreamPublishs();
     $cacheables[] = $this->getStreamChannel()->getPublishers();
     return $cacheables;
 }
Ejemplo n.º 4
0
 /**
  * @param CM_Model_Stream_Abstract $stream
  * @throws CM_Exception_Invalid
  * @throws CM_Janus_StopStreamError
  */
 protected function _stopStream(CM_Model_Stream_Abstract $stream)
 {
     /** @var $streamChannel CM_Model_StreamChannel_Media */
     $streamChannel = $stream->getStreamChannel();
     $server = $this->_serverList->getById($streamChannel->getServerId());
     $result = $this->_httpApiClient->stopStream($server, $stream->getKey());
     if (array_key_exists('error', $result)) {
         throw new CM_Janus_StopStreamError($result['error']);
     }
 }
Ejemplo n.º 5
0
 /**
  * @param CM_Model_Stream_Abstract $stream
  */
 protected function _stopStream(CM_Model_Stream_Abstract $stream)
 {
     /** @var $streamChannel CM_Model_StreamChannel_Video */
     $streamChannel = $stream->getStreamChannel();
     $this->_stopClient($stream->getKey(), $streamChannel->getPrivateHost());
 }