agence104 / livekit-server-sdk-php

PHP Server SDK to LiveKit
Apache License 2.0
41 stars 16 forks source link

Unable to set AutoEgress while creating new room #14

Closed hazhayder closed 3 months ago

hazhayder commented 6 months ago

I am trying to set AutoEgress while creating room I am using docker-compose to deploy livekit on VPS, below is the code snippet and the output is attached below code-snapshot image

shakaran commented 5 months ago

@hazhayder could you copy and paste the code or attach the file for run easy from the code? It is hard to debug this if the mantainer has to write every line in the image

hazhayder commented 5 months ago

@hazhayder could you copy and paste the code or attach the file for run easy from the code? It is hard to debug this if the mantainer has to write every line in the image ` public function attempt(string $token) { $s3Upload = (new S3Upload())->setAccessKey("HasnainHaider")->setSecret("HasnainHaider")->setEndpoint("https://minio.exodevs.com")->setBucket("livekit")->setRegion(""); $roomServiceClient = new RoomServiceClient(env('LIVEKIT_HOST'), env('LIVEKIT_API_KEY'), env('LIVEKIT_API_SECRET')); $newRoomOptions = new RoomCreateOptions(); $roomEgress = new RoomEgress(); $autoTrackEgress = new AutoTrackEgress(); $autoTrackEgress = $autoTrackEgress->setS3($s3Upload)->setFilepath("livekit/{room_name}-{publisher_identity}-{time}"); $roomEgress = $roomEgress->setTracks($autoTrackEgress); $newRoomOptions = $newRoomOptions->setEgress($roomEgress); $newRoomOptions = $newRoomOptions->setName("HasnainNewRoom");

    $roomServiceClient->createRoom($newRoomOptions);

    $rooms = $roomServiceClient->listRooms();

    $egressClient = new EgressServiceClient(env('LIVEKIT_HOST'), env('LIVEKIT_API_KEY'), env('LIVEKIT_API_SECRET'));
    $outputConfig = new EncodedFileOutput();
    return view('test.attempt');

}`

ashwin-nath-m commented 4 months ago

@hazhayder

$s3Upload = (new S3Upload())
            ->setAccessKey(config('linode.key'))
            ->setSecret(config('linode.secret'))
            ->setEndpoint(config('linode.endpoint'))
            ->setRegion(config('linode.region'))
            ->setBucket(config('linode.bucket'));
$tracks= (new AutoTrackEgress())
            ->setFilepath('livekit/test')
            ->setS3($s3Upload);
 $roomEgress =  (new RoomEgress())->setTracks($tracks);
 $opts = (new RoomCreateOptions())
            ->setName($roomName)
            ->setEmptyTimeout(15)
            ->setEgress($roomEgress);
$this->roomServiceClient->createRoom($opts);

And the error is

Expect integer. file":"....vendor/google/protobuf/src/Google/Protobuf/Internal/GPBUtil.php:111"
hazhayder commented 4 months ago

@hazhayder

$s3Upload = (new S3Upload())
            ->setAccessKey(config('linode.key'))
            ->setSecret(config('linode.secret'))
            ->setEndpoint(config('linode.endpoint'))
            ->setRegion(config('linode.region'))
            ->setBucket(config('linode.bucket'));
$tracks= (new AutoTrackEgress())
            ->setFilepath('livekit/test')
            ->setS3($s3Upload);
 $roomEgress =  (new RoomEgress())->setTracks($tracks);
 $opts = (new RoomCreateOptions())
            ->setName($roomName)
            ->setEmptyTimeout(15)
            ->setEgress($roomEgress);
$this->roomServiceClient->createRoom($opts);

And the error is

Expect integer. file":"....vendor/google/protobuf/src/Google/Protobuf/Internal/GPBUtil.php:111"

Were you able to get around this error?

p-delorme commented 4 months ago

I don't think any tests have been written about this specific case. I'll do some testing on my end, and report back as soon as I can.

ashwin-nath-m commented 4 months ago

@p-delorme i have found an issue. created pr

p-delorme commented 4 months ago

Great Catch. I'll get that fix asap. Thanks @ashwin-nath-m

p-delorme commented 4 months ago

The PR has been merged.

p-delorme commented 4 months ago

A new release has been created. Feel free to test and report if this fixes the issue.