public function redirect($control_url, $app, $name, $new_adress, $new_clientid, $new_name, $type = 'publisher', $srv = null)
    {
        $query = [];
        $query['app'] = $app;
        $query['name'] = $name;
        $query['addr'] = $new_adress;
        $query['clientid'] = $new_clientid;
        $query['newname'] = $new_name;

        if ($srv) {
            $query['srv'] = $srv;
        }

        $client = new Client();
        try {
            $response = $client->request(
                'GET',
                $url .'/control/redirect/'.$type,
                [
                    'query' => $query
                ]
            );
        } catch (RequestException $e) {
            return false;
        }
        catch (Exception $e) {
            return false;
        }

        return true;
    }
public function redirect($control_url, $app, $name, $new_adress, $new_clientid, $new_name, $type = 'publisher', $srv = null)
    {
        $query = [];
        $query['app'] = $app;
        $query['name'] = $name;
        $query['addr'] = $new_adress;
        $query['clientid'] = $new_clientid;
        $query['newname'] = $new_name;

        if ($srv) {
            $query['srv'] = $srv;
        }

        $client = new Client();
        try {
            $response = $client->request(
                'GET',
                $url .'/control/redirect/'.$type,
                [
                    'query' => $query
                ]
            );
        } catch (RequestException $e) {
            return false;
        }
        catch (Exception $e) {
            return false;
        }

        return true;
    }
public function redirect ( $ control_url , $ app , $ name , $ new_adress , $ new_clientid , $ new_name , $ type = 'publisher' , $ srv = null ) { $ query = [ ] ; $ query [ 'app' ] = $ app ; $ query [ 'name' ] = $ name ; $ query [ 'addr' ] = $ new_adress ; $ query [ 'clientid' ] = $ new_clientid ; $ query [ 'newname' ] = $ new_name ; if ( $ srv ) { $ query [ 'srv' ] = $ srv ; } $ client = new Client ( ) ; try { $ response = $ client -> request ( 'GET' , $ url . '/control/redirect/' . $ type , [ 'query' => $ query ] ) ; } catch ( RequestException $ e ) { return false ; } catch ( Exception $ e ) { return false ; } return true ; }
sends a redirect command to the rtmp server
@var app the rtmp app name
@var name the streamkey
@var new_adress the optional client adress
@var clientId the optional nginx client id
@var new_name new stream name to redirect to (streamkey)
@var new_clientid optional nginx client id
sends a redirect command to the rtmp server