PRESTO_VIDEOCOMPLETE::video_progress( $video_id,  $percent )


Source

File: src/integrations/presto/triggers/presto-videocomplete.php

	public function video_progress( $video_id, $percent ) {
		if ( $percent == 100 ) {

			$user_id = get_current_user_id();

			$args = array(
				'code'    => $this->trigger_code,
				'meta'    => $this->trigger_meta,
				'post_id' => $video_id,
				'user_id' => $user_id,
			);

			$arr = Automator()->maybe_add_trigger_entry( $args, false );

			if ( $arr ) {
				foreach ( $arr as $result ) {
					if ( true === $result['result'] ) {
						Automator()->maybe_trigger_complete( $result['args'] );
					}
				}
			}
		}
	}