Open fmk1233 opened 6 months ago
public function createRoom(string $name) { $roomName = $this->getRoomName(); $token = $this->getToken($name, $roomName); $svc = new RoomServiceClient($this->host, $this->apikey, $this->secretkey); $s3Upload = (new S3Upload()) ->setAccessKey($this->s3_key) ->setSecret($this->s3_secret) ->setEndpoint($this->s3_endpoint) ->setRegion($this->s3_region) ->setBucket($this->s3_bucket); $tracks= (new AutoTrackEgress()) ->setFilepath('test.mp4') ->setS3($s3Upload); $roomEgress = (new RoomEgress())->setTracks($tracks); $opts = (new RoomCreateOptions()) ->setName($roomName) ->setEmptyTimeout(10) ->setMaxParticipants(2) ->setEgress($roomEgress); $room = $svc->createRoom($opts); $this->redis->rPush('room'.$roomName, $name); $this->result(['token' => $token, 'roomName' => $roomName]); }