fsb_video_loop

The fsb_video_loop filter allows developers to control whether or not videos that are shown in the background are played on a repeating loop, or if they are only played once.

Note: This filter cannot control YouTube videos. YouTube videos are only played once. There is no setting to be able to repeat a YouTube video.

By default, videos are set to be played on a repeating loop. The filter expects a true/false (bool) response.

  • true (default): video will play in a repeating loop.
  • false: video will play once until it is finished then stop.

The filter is passed two attributes:

  • $loop (true): whether or not the video should loop on repeat.
  • $video_id: the ID of the video from Full Screen Background Images. ID can be found in Appearance > Fullscreen BG Image in the left column next to the video.

If you want to loop certain videos but not others, you can use the filter like this

add_filter( 'fsb_video_loop', 'my_function', 2 );
function my_function( $loop, $video_id ){
	// Loop all videos except for the video with ID 2.
	if( 2 == $video_id) {
		$loop = false;
	}
	return $loop;
}