[SOLVED] Confirmed Bug: Background video fails to load with errors 403 and CORS


Note: This bug was fixed and the API now works as advertised.


I can change with code page backgrounds with images but not with videos using $w(Document).background.src
I’m talking about changing between stock Wix background videos in the Wix video manager, not external videos.

So with the API one can obtain the URLs for images and videos and they look like these:
wix:image://v1/8034aa3291a54c489a7b7a3121d994f9.png/Bananas.png#originWidth=1177&originHeight=1200

wix:video://v1/11062b_03c50f8fe4a34cc297a984e483a282ef/_#posterUri=/11062b_03c50f8fe4a34cc297a984e483a282eff000.jpg&posterWidth=1920&posterHeight=1080

I store the URL in session storage and then reload the page.
Then I can change the page background with this code inside the onReady():

$w("Document").background.src = "wix:image:// ...";

$w("Document").background.src = "wix:video:// ...";

Works for images, fails for videos.
Chrome just fails with this:


This lead me to believe that the URL for the video was bad.
I spent too much time looking, testing and looking some more for an answer.
Finally, using MS Edge, I got two different error messages that were helpful:


and occasionally:


Plugging one of the Wix video URLs into Chrome gives this 403 error:


So I have to conclude that Wix/Corvid is not allowing my Wix pages to access stock Wix videos in the Wix video manager - which should be an error on the Wix/Corvid end, not a feature.

Here is a test page so you can see the error messages when requesting a change of video background:

(use Chrome or MS Edge and look at console - FireFox has an error message that blocks the other messages)
https://www.ualmatrix.com/clock-minimal-image

After initial load click the “Show URL” button first so you can confirm the current video URL.Then select backgrounds from the “Theme” dropdown list.
Note that the images work (page reloads and changes background image inside the onReady() ), and the videos have various failures:

Sometimes they fail with a 403 message and no backup image, and others show the backup image without an error message.
Occasionally a CORS error pops up too.
Full URL for Wix video background “Ocean”

wix:video://v1/11062b_95d34f15761e4114a57b17823228948e/_#posterUri=11062b_95d34f15761e4114a57b17823228948ef000.jpg&posterWidth=1920&posterHeight=1080

Apparently, that gets converted internally by the Wix server to:

https://video.wixstatic.com:443/11062b_95d34f15761e4114a57b17823228948e/1080p/mp4/file.mp4

And since Wix thinks thinks my Wix page should not have access to that URL, it loads the poster instead (some files do and some don’t):

_#posterUri=11062b_95d34f15761e4114a57b17823228948ef000.jpg&posterWidth=1920&posterHeight=1080

To summarize the dilemma:
If my Wix/Corvid pages can change stock Wix background images, then the same should also apply to stock Wix background videos. Instead, the video URLs are blocked, resulting in a 403/CORS error.

Since videos are bandwidth intensive, I can see why Corvid would be careful with them, but it seems they went a bridge too far when a Wix/Corvid page cannot access Wix/Corvid stock videos.

Maybe I’m overlooking something I can do on my end, but this looks very much like a problem on the Wix end of things.

Wix/Corvid has server settings that allow page background image changes in the onReady() part of pages. But, it prohibits page background videos to be changed the same way as the images.

Looks like a Wix/Corvid system error to me (or a flawed policy), not a feature.
Since this is a suspected bug, I sent it to tech support.
They told me to place the concern in the forums - the usual circular reference games.

Any assistance with this matter is greatly appreciated.

Right?

Workaround:
Make a separate page (a copy of original) for each desired background video option.
In my example about 9 or 10 pages, instead of one.

It may not affect bandwidth since either way a page has to be reloaded in order to obtain a different video background.
But, Wix/Corvid has to store 10 pages instead of 1.
And the user has the hassle of maintaining 10 pages.

Any official comments?
Anyone, anyone … Bueller?

Well, it’s been about a week.
I’d say that should be ample time for somebody to look into this or at least comment in some way.

How about a moderator or any other official providing a little bit of tech support?
I’ll help out here -

(A) We haven’t looked at it yet.
(B) Looked - this should work - it’s a bug.
(C) Looked - it’s a policy - you can’t have it.
(D) We don’t care because you’re the only one making noise with this issue.
(E) We don’t comment on ongoing investigations.
and just for completeness sake, just in case:
(F) We just don’t care. We may or may not comment - only if and when we feel like it.

If that’s the case, that should be the grade they earned for customer support via this forum.

@deleteduser Interesting. Didn’t know that existed. Wix is cool, but without code it’s too limiting. Wix without Code (Corvid) is like an airplane without fuel - looks cool, but it won’t get you where you need to go.

@brainstorrrm Yeah, I’ll go with F as well…F to pay my respects for the death of this thread without Wix responding :frowning:

This is very bizarre. I’m not sure what the policy is supposed to be. I don’t want to call it a “flawed” policy until I hear the explanation from the appropriate source here at Wix.

I sent this on to QA for evaluation.

Hi,

There is a regression on Wix side - we are working to solve it.

Thanks.

Hello. Thank you for providing all these details.
After further investigation, we found out that there is an issue with format in which $w(“Document”).background.src returns Wix video url. There is an extra “/” symbol after “#posterUri=”
We have already reported this issue to our developers.

Meanwhile, you can try to remove this extra symbol, or obtain correct URLs using src property of the video player component - it should work fine.

Once again, thank you for highlighting this.

Regards, Aleksander

@Aleksander Denga
@Alexander Jdanov
Thank you very much!

However, I don’t see the extra “/” in the url.
Also, I got the url using the .src property of the wix video player component:
It is identical to the one of the $w(“Document”).background.src

Sample page:
https://www.ualmatrix.com/blank

@brainstorrrm maybe try some voodoo and assign the page’s background src to itself with a .replace(‘#posterUri=/’, ‘#posterUri=’); ?? Just a thought. Maybe you could splice everything after that and join it to this base…

@brainstorrrm Hi. I just concluded this out of the screenshots you provided with console errors here
I see that the video background is now working fine on the page you mentioned. Please let me know if you still experiencing this issue.

Regards, Aleksander

@aleksander-denga

On the original test page , half the URLs had the extra “/” and half did not.

// default stormy skies
// wix:video://v1/11062b_8e792646ca71495b96677c20e27e9122/ _#posterUri=/ 11062b_8e792646ca71495b96677c20e27e9122f000.jpg&posterWidth=1920&posterHeight=1080
// Palms
// wix:video://v1/11062b_d013b164dadb47ec8e746ab178aacfbb/#posterUri=11062b_d013b164dadb47ec8e746ab178aacfbbf000.jpg&posterWidth=1920&posterHeight=1080
// Particle
// wix:video://v1/11062b_03c50f8fe4a34cc297a984e483a282ef/ **
#posterUri=/** 11062b_03c50f8fe4a34cc297a984e483a282eff000.jpg&posterWidth=1920&posterHeight=1080
// Ocean
// wix:video://v1/11062b_95d34f15761e4114a57b17823228948e/#posterUri=11062b_95d34f15761e4114a57b17823228948ef000.jpg&posterWidth=1920&posterHeight=1080
// Underwater
// wix:video://v1/11062b_41148c6b0dca4f42b8380089fd183012/
#posterUri=11062b_41148c6b0dca4f42b8380089fd183012f000.jpg&posterWidth=1920&posterHeight=1080
// Making Waves
// wix:video://v1/11062b_f1fbf8b243e942a692e564fac5382513/#posterUri=11062b_f1fbf8b243e942a692e564fac5382513f000.jpg&posterWidth=1920&posterHeight=1080
// Melting Ice
// wix:video://v1/11062b_9480d9d800bd4bda938057d5ac1ebc42/
#posterUri=11062b_9480d9d800bd4bda938057d5ac1ebc42f000.jpg&posterWidth=1920&posterHeight=1080
// Water Drop
// wix:video://v1/11062b_830709c744404d6ea7a10dcfd88e3a48/ _#posterUri=/ 11062b_830709c744404d6ea7a10dcfd88e3a48f000.jpg&posterWidth=1920&posterHeight=1080
// Submerged
// wix:video://v1/11062b_64ae2a899006496dac01c2e81fac97f1/ _#posterUri=/ 11062b_64ae2a899006496dac01c2e81fac97f1f000.jpg&posterWidth=1920&posterHeight=1080

While it is trivial to remove the extra “/” with code …

None of the video backgrounds load in the onReady() - with or without the extra “/” in the url.

Thank you for your attention to this vexing bug.

@brainstorrrm Can you please share link to the page, where you use video background without extra “/” and it is not working for you. This will help us to allocate the problem quicker. Thank you

@aleksander-denga
https://www.ualmatrix.com/clock-minimal-image

@brainstorrrm Thank you.
I created two pages, based on the video links you’re using in your test page: on one page video URLs are containing ‘/’ symbol after #posterUrl and on another page - doesn’t.
All video files are loading for me without console errors on the second page, please see https://aleksanderd7.wixsite.com/mysite

Do you still see the same console errors in your case? What do you see as a background when trying to load video in onReady() ? Can you record a video and share it here?

Regards, Aleksander

I see that there is a different issue - for some reason video is not playing after was loaded. I’ve notified our developers about it as well.

Exactly.
When you request the video background, Wix/Corvid loads only the poster (jpg) - no video plays. I consider that “not loading” the video, because it only loads the backup jpg.

It’s been yet another week …