Unyson-Shortcodes-Extension icon indicating copy to clipboard operation
Unyson-Shortcodes-Extension copied to clipboard

Section Background Video Doesn't Work

Open Saxtone opened this issue 10 years ago • 1 comments

With the deprecation of wallpaper.js and the new addition of background.js, the section background option stopped working. I think the problem is in the json_encode part which takes the video link and puts in the data-background-options attribute.

$bg_video_data_attr = $data_name_attr.'="' . fw_htmlspecialchars( json_encode( array( 'source' => array( $filetype => $atts['video'] ) ) ) ) . '"';

I think the issue is in the lack of a poster attribute in source, which displays an image on mobile instead of a video. A possible solution is to put the background_image specified for the section in the poster attribute:

$bg_video_data_attr = $data_name_attr.'="' . fw_htmlspecialchars( json_encode( array( 'source' => array(
         $filetype => $atts['video'],
        'poster' => $atts['background_image']['data']['icon']
        ) ) ) ) . '"';

Saxtone avatar Feb 12 '16 16:02 Saxtone

There also seems to be a problem in Firefox ( I'm using Firefox 44.0.2 ) with the video. Sometimes when the page is loaded, the video starts to flicker which is pretty strange. There seems to be no problem in Chrome. P.S. The video flickers when it loops itself. It has to be something with the poster attribute. UPDATE: I tested it with unyson disabled and a direct video tag on the page and the problem still persists. Looks like the problem is in firefox itself. If the video is 1-5 seconds long there is a high chance for it to flicker when it is looped.

Saxtone avatar Feb 12 '16 17:02 Saxtone