コード例 #1
0
ファイル: StreamRepository.php プロジェクト: cargomedia/cm
 /**
  * @param CM_Model_Stream_Abstract $stream
  */
 public function removeStream(CM_Model_Stream_Abstract $stream)
 {
     $streamChannel = $stream->getStreamChannel();
     $stream->delete();
     if (!$streamChannel->hasStreams()) {
         $streamChannel->delete();
     }
 }
コード例 #2
0
ファイル: Abstract.php プロジェクト: NicolasSchmutz/cm
 /**
  * @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);
 }
コード例 #3
0
ファイル: Publish.php プロジェクト: cargomedia/cm
 protected function _getContainingCacheables()
 {
     $cacheables = parent::_getContainingCacheables();
     $cacheables[] = $this->getStreamChannel()->getStreamPublishs();
     $cacheables[] = $this->getStreamChannel()->getPublishers();
     return $cacheables;
 }
コード例 #4
0
ファイル: Service.php プロジェクト: cargomedia/cm
 /**
  * @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']);
     }
 }
コード例 #5
0
ファイル: Wowza.php プロジェクト: NicolasSchmutz/cm
 /**
  * @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());
 }