Skip to main content
1 of 4

How to create a Tridion DXA View Model to View (JSP) for a video field (mp4 or mpeg)?

I have tried to define a model using MediaItem class(see Example below) but not working. I know how to do it using YouTubeVideo or embeded video

Also, When I extract MediaItem.java abstract class the mp4 mime type is not defined(MimeUtils.java)

Can you please provide the solution or existing example ?

Ex:

@JsonProperty("video")
@SemanticProperty("gv:video")
private MediaItem video;
 
public MediaItem getvideo() {
    return video;
}

public void setvideo(MediaItem video) {
    this.video = video;
}

@Override
public String toString() {
    return "GenericVideoLink [video=" + video + ", altText=" + altText
            + ", links=" + link + "]";
}