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

Invalid value for PlaybackPolicy #72

Open
BlueBazze opened this issue Aug 30, 2023 · 0 comments
Open

Invalid value for PlaybackPolicy #72

BlueBazze opened this issue Aug 30, 2023 · 0 comments

Comments

@BlueBazze
Copy link

I am not entirely sure what is going on.
It should be the exact same code as written in the example.
I have tried to hardcode "public" instead of PlaybackPolicy::_PUBLIC but it gave the exact same error.

My code

$playbackRequest = new CreatePlaybackIDRequest([
    'policy' => PlaybackPolicy::_PUBLIC
]);
$playbackID = app('mux')->createAssetPlaybackId(
    $broadcast->source->muxAssetId,
    $playbackRequest
);

The error log

[2023-08-30 10:45:34] staging.ERROR: Invalid value for enum '\MuxPhp\Models\PlaybackPolicy', must be one of: 'public', 'signed' {"userId":4,"exception":"[object] (InvalidArgumentException(code: 0): Invalid value for enum '\\MuxPhp\\Models\\PlaybackPolicy', must be one of: 'public', 'signed' at /home/.../vendor/muxinc/mux-php/MuxPhp/ObjectSerializer.php:97)
[stacktrace]
#0 /home/.../vendor/muxinc/mux-php/MuxPhp/Api/AssetsApi.php(625): MuxPhp\\ObjectSerializer::sanitizeForSerialization(Object(MuxPhp\\Models\\CreatePlaybackIDRequest))
#1 /home/.../vendor/muxinc/mux-php/MuxPhp/Api/AssetsApi.php(422): MuxPhp\\Api\\AssetsApi->createAssetPlaybackIdRequest('...', Object(MuxPhp\\Models\\CreatePlaybackIDRequest))
#2 /home/.../vendor/muxinc/mux-php/MuxPhp/Api/AssetsApi.php(404): MuxPhp\\Api\\AssetsApi->createAssetPlaybackIdWithHttpInfo('...', Object(MuxPhp\\Models\\CreatePlaybackIDRequest))
#3 /home/.../app/Services/Mux/Assets.php(15): MuxPhp\\Api\\AssetsApi->createAssetPlaybackId('...', Object(MuxPhp\\Models\\CreatePlaybackIDRequest))

The example i followed
https://github.com/muxinc/mux-php/blob/master/examples/video/exercise-assets.php#L74-L75

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