original_string: public function startRecording($stream)
      {
          $parts = explode('/', $this->streamserver_config[$stream->getRtmpServer()]['rtmp_url']);
          $rtmp_app = end($parts);
          $success = $this->record(
              $this->streamserver_config[$stream->getRtmpServer()]['rtmp_control'],
              $rtmp_app,
              $stream->getUniqID()
          );
          if ($success) {
              $stream->setTechnicalStatus(Stream::STATE_RECORDING);
              $this->em->persist($stream);
              $this->em->flush();
  
              $event = new StartRecordingStreamEvent($stream);
              $this->dispatcher->dispatch(
                  OktolabMediaEvent::STREAM_START_RECORDING,
                  $event
              );
              return true;
          }
          return false;
      }
code: public function startRecording($stream)
      {
          $parts = explode('/', $this->streamserver_config[$stream->getRtmpServer()]['rtmp_url']);
          $rtmp_app = end($parts);
          $success = $this->record(
              $this->streamserver_config[$stream->getRtmpServer()]['rtmp_control'],
              $rtmp_app,
              $stream->getUniqID()
          );
          if ($success) {
              $stream->setTechnicalStatus(Stream::STATE_RECORDING);
              $this->em->persist($stream);
              $this->em->flush();
  
              $event = new StartRecordingStreamEvent($stream);
              $this->dispatcher->dispatch(
                  OktolabMediaEvent::STREAM_START_RECORDING,
                  $event
              );
              return true;
          }
          return false;
      }
code_tokens: public function startRecording ( $ stream ) { $ parts = explode ( '/' , $ this -> streamserver_config [ $ stream -> getRtmpServer ( ) ] [ 'rtmp_url' ] ) ; $ rtmp_app = end ( $ parts ) ; $ success = $ this -> record ( $ this -> streamserver_config [ $ stream -> getRtmpServer ( ) ] [ 'rtmp_control' ] , $ rtmp_app , $ stream -> getUniqID ( ) ) ; if ( $ success ) { $ stream -> setTechnicalStatus ( Stream :: STATE_RECORDING ) ; $ this -> em -> persist ( $ stream ) ; $ this -> em -> flush ( ) ; $ event = new StartRecordingStreamEvent ( $ stream ) ; $ this -> dispatcher -> dispatch ( OktolabMediaEvent :: STREAM_START_RECORDING , $ event ) ; return true ; } return false ; }
docstring: start recording a stream.
docstring_tokens: start recording a stream .