Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot update test stream - 'Cannot use max continuous duration with test live streams' #68

Open
FreekVR opened this issue Sep 28, 2022 · 1 comment

Comments

@FreekVR
Copy link

FreekVR commented Sep 28, 2022

I am trying to use the Livestream Update request via this PHP library to update an existing livestream. I did not set an explicit max_continuous_duration either when creating or updating.

The following code sets the max_continuous_duration even if I don't define it, and even if I do define it and set it to null

$updateLivestreamRequest = new UpdateLiveStreamRequest([
  "playback_policy" => [
      0 => "public"
  ],
  "new_asset_settings" => null,
  "use_slate_for_standard_latency" => false,
  "reconnect_window" => 10,
  "latency_mode" => "low",
  "test" => true,
  "passthrough" => "Test4-2"
]);
$stream = $this->liveStreamsApi->updateLiveStream($livestream->remote_id, $updateLivestreamRequest);

This then yields the following error when sending the request

[400] Client error: `PATCH https://api.mux.com/video/v1/live-streams/kgvb005y2nnF228vfurRO5CZif6UqHAr9qg9tP8hYiN00` resulted in a `400 Bad Request` response:
{"error":{"type":"invalid_parameters","messages":["Cannot use max continuous duration with test live streams"]}}

I tried the following workaround but this gives an error down the line.

[...]
// Workaround
if ($livestream->is_test) {
    $updateLivestreamRequest->offsetUnset('max_continuous_duration');
}
$stream = $this->liveStreamsApi->updateLiveStream($livestream->remote_id, $updateLivestreamRequest);

Yields

Undefined array key "max_continuous_duration" on a different line

@FreekVR
Copy link
Author

FreekVR commented Sep 28, 2022

The following workaround, DOES work;

        // Workaround - https://github.com/muxinc/mux-php/issues/68
        if ($livestream->is_test) {
            $updateLivestreamRequest->offsetSet('max_continuous_duration', null);
        }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant