Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

action hook for player

  • Loading branch information...
commit e8617bc48596dc1ba6ac9aa19efa5865e550f09b 1 parent 2ffa9c3
Austin Matzko authored May 07, 2011

Showing 1 changed file with 13 additions and 1 deletion. Show diff stats Hide diff stats

  1. 14  video-access.php
14  video-access.php
@@ -54,6 +54,7 @@ public function __construct()
54 54
 
55 55
 		add_action( 'add_attachment', array(&$video_transcoding_control, 'remote_transcode_one_video' ) );
56 56
 		add_action( 'video_access_markup', array(&$this, 'event_video_access_markup' ) );
  57
+		add_action( 'video_access_player', array($this, 'event_video_access_player'), 10, 3 );
57 58
 		add_action( 'init', array(&$this, 'event_init' ), 1 );
58 59
 		add_action( 'template_redirect', array(&$this, 'event_template_redirect' ) );
59 60
 		add_action( 'video_transcode_complete', array( $this, 'event_video_transcode_complete' ) ); 
@@ -170,6 +171,18 @@ public function event_video_access_markup( $args = array() )
170 171
 		}
171 172
 	}
172 173
 
  174
+	public function event_video_access_player( $attach_id = 0, $width = 0, $height = 0 )
  175
+	{
  176
+		global $local_video_player;
  177
+
  178
+		$attach_id = (int) $attach_id;
  179
+		$height = (int) $height;
  180
+		$width = (int) $width;
  181
+
  182
+		$video_url = wp_get_attachment_url( $attach_id );
  183
+		echo $local_video_player->print_video_player( $video_url, 'single-video-object-' . $attach_id, $height, $width );
  184
+	}
  185
+
173 186
 	public function event_init()
174 187
 	{
175 188
 		global $wp, $wp_rewrite;
@@ -495,7 +508,6 @@ protected function _listen_for_requests()
495 508
 					$video_id = $this->model->get_video_by_hash( $blog_id, $video_file );
496 509
 					$name = $this->model->get_video_filename( $blog_id, $video_id );
497 510
 					$file_path = $this->model->get_video_actual_path( $blog_id, $video_id );
498  
-					
499 511
 					if ( file_exists( $file_path ) ) {
500 512
 						$size = filesize( $file_path );
501 513
 						@ header('Content-Type: application/octet-stream');

0 notes on commit e8617bc

Please sign in to comment.
Something went wrong with that request. Please try again.