How to increase the header video size limit?


#1

Hi Sydney Team,

Knowing that the max. video limit is 8Mb, beside putting the video in youtube, are there any other method to increase the limit?

Spencer


#2

Hello Spencer,

You can check this tutorial, it might help:

Please feel free to ask any other questions that you might have.

Kind Regards, Roman.


#3

Thank for the info Roman. I had increased the upload file size to 1000Mb.

However Sydney Pro limit the video display in home page header to 8Mb.

I set the video (15mb) at WP>Appearance>Customize>Header Area> Frontpage media. I selected the 15Mb Video, and alert comes out indicated that video over 8Mb is not allowed.


#4

Hello Spencer,

Please check Bandwidth considerations section of this post:

So it looks like default WordPress Video Header limit that is not so easy to change.

Kind Regards, Roman.


#5

Hi Roman,

Yay! Great thanks for the information. I found the way out ! =]
I found a temp solution which could override the 8mb validation from WP default:

function customize_filesize_video_validation( $validity, $value ) {
		if ( is_wp_error( $validity ) ) {$validity->remove( 'size_too_large' );	}
		$video = get_attached_file( absint( $value ) );
		if ( $video ) {
			$size = filesize( $video );
			if ( 500 < $size / pow( 1024, 2 ) ) { // Check whether the size is larger than 500MB.
				$validity->add( 'size_too_large',
					__( 'This video file is too large to use as a header video. Try a shorter video or optimize the compression settings and re-upload a file that is less than 500MB. Or, upload your video to YouTube and link it with the option below.' )
				);
			}	
		}
		return $validity;
	}
add_filter( 'customize_validate_header_video', 'customize_filesize_video_validation', 20 ,2);

Spencer


#6

You are welcome Spencer!

And thank you for sharing that!

Kind Regards, Roman.


closed #7