Description
Filter whether a video is imported by an automatic import that has a Video duration range. Skipped videos are counted as “outside the duration limits” in the activity log of the import. Available since Video Hub 2.3.3.
Parameters
- $allowed
- (bool)(required) Whether the video duration is within the limits.
- $video
- (\WPYTHub\Video)(required) The video.
- $min_duration
- (int)(required) Minimum duration in seconds; 0 for no limit.
- $max_duration
- (int)(required) Maximum duration in seconds; 0 for no limit.
Examples
Always import the videos of an automatic import whose duration YouTube doesn’t report yet.
add_filter( 'cbc_video_duration_allowed', function( $allowed, $video, $min, $max ) {
if ( ! $video->get_duration() ) {
return true;
}
return $allowed;
}, 10, 4 );