agence104 / livekit-server-sdk-php

PHP Server SDK to LiveKit
Apache License 2.0
47 stars 18 forks source link

why creating new room with AutoEgress in S3,but is`t work,the S3 is empty #19

Open fmk1233 opened 6 months ago

fmk1233 commented 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]);
    }