Hello.
When I try to load video data from Addressable in WEBGL, the following error appears:
Access to video at ‘archive:/CAB-c5d614e7e35e9b08db441a9d17faf226/CAB-c5d614e7e35e9b08db441a9d17faf226.resource’ from origin ‘https://domainname’ has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: chrome, chrome-extension, chrome-untrusted, data, http, https, isolated-app.
When I looked into it, I found that it is not possible to set a custom scheme such as archive:// in .htaccess.
How can I allow archive://?
It’s strange that png and jpg don’t cause any errors.
void Start()
{
Addressables.LoadAssetsAsync<VideoClip>("Video", null).Completed += OnVideosLoaded;
}
private void OnVideosLoaded(AsyncOperationHandle<IList<VideoClip>> obj)
{
if (obj.Status == AsyncOperationStatus.Succeeded)
{
var videoClips = obj.Result;
if (videoClips.Count > 0)
{
loadedVideoClip = videoClips[0];
PlayVideo(loadedVideoClip);
}
}
}
private void PlayVideo(VideoClip videoClip)
{
videoPlayer.source = VideoSource.VideoClip;
videoPlayer.clip = videoClip;
videoPlayer.Play();
}