protected void addSources ( Video video , Media media ) { Asset asset = getDamAsset ( media ) ; if ( asset == null ) { return ; } for ( VideoProfile profile : getVideoProfiles ( ) ) { com . day . cq . dam . api . Rendition rendition = profile . getRendition ( asset ) ; if ( rendition != null ) { video . createSource ( ) . setType ( profile . getHtmlType ( ) ) . setSrc ( urlHandler . get ( rendition . getPath ( ) ) . buildExternalResourceUrl ( rendition . adaptTo ( Resource . class ) ) ) ; } } }
Add sources for HTML5 video player