mux-php icon indicating copy to clipboard operation
mux-php copied to clipboard

Invalid value for PlaybackPolicy

Open BlueBazze opened this issue 2 years ago • 0 comments

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

BlueBazze avatar Aug 30 '23 11:08 BlueBazze