Perform actions on live recordings. Start, Stop, Pause, Unpause, Mute, Unmute

@param null $action
@param null $recordingName

@return mixed
172953
public function live($action = NULL, $recordingName = NULL)
        {
            try {

                $uri = "/recordings/live";

                if (is_null($action))
                    throw new Exception("action not specified or is null", 503);

                switch ($action) {
                    case "show":
                        $uri .= (!is_null($recordingName)) ? "/" . $recordingName : "";
                        $result = $this->pestObject->get($uri);
                        break;
                    default:
                        if (is_null($recordingName))
                            throw new Exception("recording name not specified or is null", 503);

                        $uri = "/recordings/live/" . $recordingName;
						$postData = array();

                        switch ($action) {
                            case "start":
                                throw new Exception("Starting a recording is done via channels interface - have you forgotten?", 503);
                                break;
                            case "stop":
                                $uri .= "/stop";
                                $result = $this->pestObject->post($uri, $postData);
                                break;
                            case "discard":
                                $result = $this->pestObject->delete($uri);
                                break;
                            case "pause":
                                $uri .= "/pause";
                                $result = $this->pestObject->post($uri, $postData);
                                break;
                            case "unpause":
                                $uri .= "/pause";
                                $result = $this->pestObject->delete($uri);
                                break;
                            case "mute":
                                $uri .= "/mute";
                                $result = $this->pestObject->post($uri, $postData);
                                break;
                            case "unmute":
                                $uri .= "/mute";
                                $result = $this->pestObject->delete($uri);
                                break;
                            default:
                                throw new Exception("unknown action specified", 503);
                                break;
                        }
                        break;
                }

                return $result;

            } catch (Exception $e) {
                $this->phpariObject->lasterror = $e->getMessage();
                $this->phpariObject->lasttrace = $e->getTraceAsString();

                return FALSE;
            }
        }
903766
public function doAction($actionName)
    {
        if (isset($this->actions[$actionName]))
            return call_user_func_array(array($this, $this->actions[$actionName]), array());
    }
325454
public function dispatchAction($action = false)
    {
        $action = Dispatcher::formatActionName($action);
        return $this->callAction($action);
    }
566985
public function invokeMethod($action, array $vars = array()) {
        Factory::timer()->record('controller start');
		$this->action = $action;
		if (!$this->hasMethod($action)) {
			return $this->throwErrorMethod($action);
		}
		if (true !==
            ($arg = $this->canInvoke($action))) {
			return $arg;
		}
		if (array_key_exists($action, $this->actions())) {
			return $this->runClassMethod($action);
		}
		$this->prepare();
		$result = $this->runActionMethod($this->getActionName($action), $vars);
		$this->finalize();
        Factory::timer()->record('controller end');
		return $result;
	}
92158
public static function record(Recorder $recorder)
    {
        return function (callable $handler) use ($recorder) {
            return function ($request, array $options) use ($handler, $recorder) {
                return $handler($request, $options)->then(
                  function ($response) use ($request, $recorder) {
                      $recorder->record($response);

                      return $response;
                  },
                  function ($reason) use ($request, $recorder) {
                      $response = $reason instanceof RequestException
                        ? $reason->getResponse()
                        : null;
                      if ($response) {
                          $recorder->record($response);
                      }

                      return \GuzzleHttp\Promise\rejection_for($reason);
                  }
                );
            };
        };
    }
614396
function startRecording() {
  if (room !== undefined) {
    if (!recording) {
      room.startRecording(localStream, (id) => {
        recording = true;
        recordingId = id;
      });
    } else {
      room.stopRecording(recordingId);
      recording = false;
    }
  }
}
296018
def start_recording(recorded_events_queue=None):
    
    recorded_events_queue = recorded_events_queue or _queue.Queue()
    global _recording
    _recording = (recorded_events_queue, hook(recorded_events_queue.put))
    return _recording
213519
public function beginForm(string $name, string $action): void
    {
        $this->formOptions = $this->getFormOptions($name);

        $form = "<form id=\"{$name}\" action=\"{$action}\" method=\"post\"";

        $usePjax = (isset($this->formOptions['use_pjax'])) ?
            filter_var($this->formOptions['use_pjax'], FILTER_VALIDATE_BOOLEAN)
            : true;

        $pjaxAttr = ($usePjax) ? 'data-pjax' : '';

        foreach ($this->formOptions as $attr => $value) {
            if (in_array($attr, ['use_pjax', 'use_csrf', 'fields'])) {
                continue;
            }

            $form .= " {$attr}=\"{$value}\"";
        }

        echo "$form $pjaxAttr>";
    }
1175533
public function onDuplicate($action = null)
	{
		// Save the old action so it can be returned
		$old = $this->onDuplicateAction;

		if (func_num_args() && $action !== 'error' && $action !== 'ignore' && $action !== 'replace')
		{
			throw new InvalidArgumentException("Invalid onDuplicate action '" . $action . "'. Expected: 'error', 'ignore' or 'replace'");
		}

		$this->onDuplicateAction = $action;

		return $old;
	}
1088764
public function record(Model $model = null, $name, $user = null)
    {
        if ( ! $this->isEnabled())
        {
            return false;
        }

        $activity = $this->initActivity();

        // Auto determine user if none is supplied
        $user = $this->getUserId($user);

        $data = [
            'name'    => $name,
            'user_id' => $user
        ];

        if ($model)
        {
            $data['subject_id'] = $model->getKey();
            $data['subject_type'] = get_class($model);
        }

        $activity->fill($data);

        $activity->save();

        return $activity;
    }
877543
public function action(String $action = NULL)
    {
        $time = $this->redirect['time'];
        $data = $this->redirect['data'];

        $this->redirect = [];

        if( strstr(get_called_class() , 'Refresh') )
        {
            $exit = false;
            $type = 'refresh';
        }
        
        $this->location($action, $time, $data, $exit ?? true, $type ?? 'location');
    }
791567
public function stopLiveRecording($recordingName)
    {
        $uri = "recordings/live/$recordingName/stop";
        try {
            $this->client->getEndpoint()->post($uri);
        } catch (RequestException $e) {
            $this->processRequestException($e);
        }
    }
362890
public function load(Action $action)
    {
        if ($action instanceof LoggerAwareInterface) {
            $action->setLogger(
                $this->getServiceLocator()->get(LoggerService::SERVICE_ID)
                    ->addLogger(
                        $this->hideColors
                            ? new VerboseLogger($this->getMinimumLogLevel())
                            : new ColoredVerboseLogger($this->getMinimumLogLevel())
                    )
            );
        }
    }
408676
public function execute( $action = null, $params = array() ) 
	{
		$this->set_language_alias( $action );
		
		// reset the response
		$this->response = null;
		$this->output = null;
		
		// fix notice
		$return = null;
		 
		if ( is_null( $action ) ) 
		{
			$action = static::$_default_action;
		}
		
		// capture all output made in the controller
		ob_start();
		
		// run wake event
		if ( method_exists( $this, 'wake' ) ) 
		{
			$return = call_user_func_array( array( $this, 'wake' ), $params );
		}
		
		// do we already have an resposne from the wake event?
		if ( !$return instanceof CCResponse )
		{
			// check if we got a custom action handler
			if ( !is_null( static::$_action_handler ) ) 
			{
				$return = call_user_func( array( $this, static::$_action_handler ), $action, $params );
			} 
			// normal action
			else
			{
				// check if the action exists
				if ( method_exists( $this, static::$_action_prefix.$action ) )
				{
					$return = call_user_func_array( array( $this, static::$_action_prefix.$action ), $params );
				}
				else 
				{
					$return = CCResponse::error( 404 );
				}
			}
		}
		
		// get the output
		$this->output = ob_get_clean();
		
		// do we got a response now?
		if ( $return instanceof CCResponse ) 
		{
			$this->response = $return;
		}
		// or a string
		elseif ( !empty( $return ) && is_string( $return ) )
		{
			$this->response = $this->_respond( $return );
		}
		
		// do we got a valid response if not use controller output		
		if ( !$this->response instanceof CCResponse ) 
		{
			$this->response = $this->_respond( $this->output );
		}
		
		// run sleep event
		if ( method_exists( $this, 'sleep' ) ) 
		{
			call_user_func_array( array( $this, 'sleep' ), $params );
		}
		
		// return thaaaaat
		return $this->response;
	}
773680
public function recordUserActionOnItem($action = 'view', $userId, $itemId, array $properties = [], $eventTime = null)
    {
        return $this->createCustomEvent($action, 'user', $userId, 'item', $itemId, $properties, $eventTime);
    }
280866
function (cb) {

                    let actions = req.linz.model.linz.formtools.overview.actions;

                    if (!actions.length) {
                        return cb(null);
                    }

                    parseDisabledProperties(req.linz.record, actions)
                        .then((parsedActions) => {

                            actions = parsedActions;

                            return cb();

                        })
                        .catch(cb);

                }
372947
function get_recorder($id) {
        try {
            $param = new \Panopto\RemoteRecorderManagement\GetRemoteRecordersById($this->auth, array($id));
            $recorder = $this->rrmclient->GetRemoteRecordersById($param)->getGetRemoteRecordersByIdResult();
        } catch(Exception $e) {
            throw new SoapFault('client', $e->getMessage());
        }
        return $recorder->getRemoteRecorder()[0];
    }