Video Players not working in cloud

0
Hi, I am looking for a solution for playing video files from a URL in Mendix. The video files are being stored in Amazon S3 servers, I'm generating a signed URL and need to play the videos. I've tried using "Audio Video Playback" and "JWPlayer" from the app store. Both of them work perfectly fine when running locally but both give various issues when pushed to a cloud environment.   Audio Video Playback just breaks everything, I mean the package builds fine but no pages load, I just get a white screen every time I attempt to visit the landing or log in pages. JWPlayer only effects the pages I'm using it on, they basically just load endlessly.    Tthe database is PGSQL based. I just want the videos to play by the URL, wether through another solution or a fix for the ones I've already tried using. Any suggestions or ideas?
asked
2 answers
2

I think this is related to the bundling of widgets to a single file.
When running in the cloud Mendix bundles all widgets in your package to single javascript file, something it doesn't do by default locally.

A known issue with bundling of widgets is that minified javascript files might cause problems (see this answer)
The Audio Video Playback widget uses just such a minified file. Probably the JWPlayer does so too..

You can direct Mendix to bundle the widget files when running locally too, through Settings > Modeler.
For me, enabling this results in the same problem you describe when running in the cloud (tried it for Audio Video Player).

I'd suggest filing an issue with the widget developer on GitHub here.

Alternatively, if you're comfortable with tinkering with the widget yourself, you can swap out the minified version of the libraries with unminified ones. For me this solved the issue (again, tried it with Audio Video Player).
Or you can grab my fork of the widget and try that.

Hope this helps!

answered
1

I checked and Jeroen is correct on this one, it has to do with widget bundling. I have done my fair share of widget building and found the following problem:

When we create a package for the cloud, Mendix takes every widget and bundles it into 1 single widget file through a Dojo Build task. For every widget file (javascript) the Dojo Build task will run through it and do some string checking. Basically, it checks if it can find a 'define' task in it. If so, it leaves it untouched. If it doesn't, it wraps it with its own define function.

So the libraries that are in Audio Video Playback (didn't check the other one at the moment) have a UMD wrapper, which should work fine. The problem? Because it is minified, it doesn't get picked up by Dojo Build. It's a 'dumb' problem basically. Found this to be the issue while building a Typescript Widget Boilerplate, that you can find here (this is not production ready yet, but does seem to work).

Still trying to find the exact premises on when this issue occurs. My minified code is wrapped as AMD, not UMD, which works fine. 

 

answered