File tree Expand file tree Collapse file tree 2 files changed +22
-5
lines changed
system/application/views/melons/cantaloupe Expand file tree Collapse file tree 2 files changed +22
-5
lines changed Original file line number Diff line number Diff line change @@ -589,7 +589,13 @@ a:hover { text-decoration: underline; }
589
589
.image_header .has_video {
590
590
position : relative;
591
591
}
592
- .splash .video_wrapper , .image_header .video_wrapper {
592
+ .visual_path .sp-block .has_video h1 , .visual_path .sp-block .has_video .sp-block__content {
593
+ position : relative; z-index : 1 ;
594
+ }
595
+ .visual_path .sp-block .has_video .video_wrapper {
596
+ z-index : 0 ;
597
+ }
598
+ .splash .video_wrapper , .image_header .video_wrapper , .visual_path .video_wrapper {
593
599
position : absolute;
594
600
top : 0 ; right : 0 ; bottom : 0 ; left : 0 ;
595
601
overflow : hidden;
Original file line number Diff line number Diff line change 2939
2939
} ;
2940
2940
} ;
2941
2941
var default_view = pathContents [ i ] . current . defaultView ;
2942
- var media_urls = [ ] ;
2943
2942
$ ( "[property='sioc:content']" ) . append ( '<div class="sp-block sp-block-' + default_view + '" id="' + slug + '"><h1 class="padded-multiline"><a class="sp-title" href="' + base_url + slug + '">' + title + '</a></h1><div class="sp-block__content ' + slug + '">' + ( ( description . length ) ?description :'' ) + '</div></div>' ) ;
2944
2943
// set background
2945
- $ ( "#" + slug ) . css ( { "background-image" : 'url("' + ( ( key . length ) ?key :'' ) + '")' } ) . find ( '.sp-block__content' ) . append ( '<div><a class="nav_btn primary" href="' + base_url + slug + '">Continue</a></div>' ) ;
2946
- if ( description . length ) {
2947
- $ ( "." + slug ) . css ( "background-color" , "#fff" ) ;
2944
+ if ( '.mp4' == key . substr ( key . length - 4 , 4 ) ) { // The controller looks for ".mp4" so do the same here ~cd
2945
+ $ ( "#" + slug ) . addClass ( 'has_video' ) . prepend ( '<div class="video_wrapper"><video autoplay muted loop playsinline preload="none"><source src="' + key + '" type="video/mp4"></video></div>' ) ;
2946
+ $ ( "#" + slug ) . find ( '.video_wrapper video:first' ) . on ( 'loadedmetadata' , function ( ) {
2947
+ var $video = $ ( this ) ;
2948
+ $video . data ( 'orig_w' , parseInt ( $video . get ( 0 ) . videoWidth ) ) ;
2949
+ $video . data ( 'orig_h' , parseInt ( $video . get ( 0 ) . videoHeight ) ) ;
2950
+ $ ( window ) . resize ( function ( ) {
2951
+ cover_video . call ( $video . get ( 0 ) ) ;
2952
+ } ) . trigger ( 'resize' ) ;
2953
+ } ) ;
2954
+ } else {
2955
+ $ ( "#" + slug ) . css ( { "background-image" : 'url("' + ( ( key . length ) ?key :'' ) + '")' } ) ;
2948
2956
} ;
2957
+ // end set background
2958
+ $ ( '#' + slug ) . find ( '.sp-block__content' ) . append ( '<div><a class="nav_btn primary" href="' + base_url + slug + '">Continue</a></div>' )
2959
+ if ( description . length ) $ ( "." + slug ) . css ( "background-color" , "#fff" ) ;
2949
2960
$ ( "#" + slug ) . append ( '<div style="visibility:hidden; clear:both; height:1px; overflow:hidden;"></div>' ) ;
2950
2961
}
2951
2962
}
You can’t perform that action at this time.
0 commit comments