Template::stream_video( $template )


Source

File: classes/Template.php

	function stream_video( $template ) {
		if ( is_dozent_single_lecture() && get_query_var( 'lecture_video' ) === 'true' ) {
			/**
			 * Filter to default start video stream behaviour
			 *
			 * @param bool $bool Default false
			 * @param int $lectureID Lecture ID
			 */

			$should_start = apply_filters( 'dozent_video_start_stream', false, get_the_ID() );
			if ( $should_start ) {
				$video = dozent_get_video();
				if ( $video ) {
					$stream = new VideoStream( dozent_array_get( 'path', $video ) );
					$stream->start();
				}
				exit();
			}

			exit( __( 'Video is protected', 'dozent' ) );
		}

		return $template;
	}