Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I want to build a macro that lets the user pic a media-file (video) and then embeds it in the page.
I want to use a macro so i can use it in the grid-system.
My initial plan is to use the video tag to do it and use mp4 files because the work in almost every browser.
How do i let the user select a media object in the macro config and how do i make sure the video scales properly depending on screen resolution?
KR, Mikael
hi Mikael If you use a HTML video tag ("Video") in the partial view, the video rezise automatically.
var MediaId = Model.MacroParameters["Video"]; var media = Umbraco.Media(MediaId); var MediaId2 = Model.MacroParameters["Image"]; var media2 = Umbraco.Media(MediaId2); <a href="@url" target="@target"> <video controls autoplay controlsList="nodownload" width="100%" height="100%" controls poster=@media2.umbracoFile > <source src=@media.umbracoFile type="video/mp4" style="width:100%;"> </video>
Finally in the macro parameters add an Image Media Picker to allow user select the video.
Regards. Martin
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Building a macro for embeding videos
I want to build a macro that lets the user pic a media-file (video) and then embeds it in the page.
I want to use a macro so i can use it in the grid-system.
My initial plan is to use the video tag to do it and use mp4 files because the work in almost every browser.
How do i let the user select a media object in the macro config and how do i make sure the video scales properly depending on screen resolution?
KR, Mikael
hi Mikael If you use a HTML video tag ("Video") in the partial view, the video rezise automatically.
Finally in the macro parameters add an Image Media Picker to allow user select the video.
Regards. Martin
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.