public function test_cl_video_tag_with_poster() { $expected_url = CloudinaryTest::VIDEO_UPLOAD_PATH . "movie"; $expected_poster_url = 'http://image/somewhere.jpg'; $this->assertEquals(cl_video_tag('movie', array('poster' => $expected_poster_url, 'source_types' => "mp4")), "<video poster='{$expected_poster_url}' src='{$expected_url}.mp4'></video>"); $expected_poster_url = CloudinaryTest::VIDEO_UPLOAD_PATH . "g_north/movie.jpg"; $this->assertEquals(cl_video_tag('movie', array('poster' => array('gravity' => 'north'), 'source_types' => "mp4")), "<video poster='{$expected_poster_url}' src='{$expected_url}.mp4'></video>"); $expected_poster_url = CloudinaryTest::DEFAULT_UPLOAD_PATH . "g_north/my_poster.jpg"; $this->assertEquals(cl_video_tag('movie', array('poster' => array('gravity' => 'north', 'public_id' => 'my_poster', 'format' => 'jpg'), 'source_types' => "mp4")), "<video poster='{$expected_poster_url}' src='{$expected_url}.mp4'></video>"); $this->assertEquals(cl_video_tag('movie', array('poster' => NULL, 'source_types' => "mp4")), "<video src='{$expected_url}.mp4'></video>"); $this->assertEquals(cl_video_tag('movie', array('poster' => FALSE, 'source_types' => "mp4")), "<video src='{$expected_url}.mp4'></video>"); }
/** * @param $iWidth * @param $iHeight * @return null|string */ public function VideoTag($iWidth, $iHeight) { return cl_video_tag($this->PublicID . '.' . $this->Format, array('width' => $iWidth, 'height' => $iHeight, 'controls')); }