I added a video to the Media folder. How can I use it as background for the login screen?
I also tried with a web component but I do not know how to reference that file in the Media folder.
Thanks
I added a video to the Media folder. How can I use it as background for the login screen?
I also tried with a web component but I do not know how to reference that file in the Media folder.
Thanks
Hi,
I had a quick play as I was curious myself on how easy this would be.
This is the result of my attempt: [attachment=0]video_example.servoy[/attachment]
What steps did I take:
var _sTemplate = '<video playsinline autoplay muted loop><source src="[MEDIA_URL]" type="[MIME_TYPE]">Your browser does not support the video tag.</video>';
var _sMediaName = 'sample_video.webm';
var _sMediaURL = application.getMediaURL(_sMediaName).replace(/\?.*$/, '');
var _sMimeType = solutionModel.getMedia(_sMediaName).mimeType;
var _sHtml = _sTemplate.replace(/\[MEDIA_URL\]/, _sMediaURL).replace(/\[MIME_TYPE\]/, _sMimeType);
elements.lbl_bg_video.text = _sHtml;
video {
object-fit: cover;
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 100%;
}
.video-wrapper {
position: relative;
overflow: hidden;
text-align: center;
display: flex;
align-items: center;
justify-content: center;
}
This is it and after launching the client, you should see the video playing.
Hope this helps
video_example.servoy (1.02 MB)
Thank you Marc!
Nice!
Glad that worked out for you