open($player_package)) { $contents = ""; $dir = $zip->getNameIndex(0); $fp = $zip->getStream($dir . "player.swf"); if (!$fp) return READ_ERROR; while(!feof($fp)) { $contents .= fread($fp, 2); } fclose($fp); $result = @file_put_contents(LongTailFramework::getPrimaryPlayerPath(), $contents); if (!$result) { return WRITE_ERROR; } chmod(LongTailFramework::getPrimaryPlayerPath(), 0755); $contents = ""; $fp = $zip->getStream($dir . "yt.swf"); if ($fp) { while (!feof($fp)) { $contents .= fread($fp, 2); } fclose($fp); $result = @file_put_contents(str_replace("player.swf", "yt.swf", LongTailFramework::getPrimaryPlayerPath()), $contents); if (!$result) { return WRITE_ERROR; } chmod(str_replace("player.swf", "yt.swf", LongTailFramework::getPrimaryPlayerPath()), 0755); } $fp = $zip->getStream($dir . "jwplayer.js"); if ($fp) { $contents = ""; while (!feof($fp)) { $contents .= fread($fp, 2); } fclose($fp); $result = @file_put_contents(LongTailFramework::getEmbedderPath(), $contents); if (!$result) { return WRITE_ERROR; } chmod(LongTailFramework::getEmbedderPath(), 0755); } $zip->close(); } unlink($player_package); return SUCCESS; } function zip_fallback($player_package) { $player_found = false; require_once(ABSPATH . 'wp-admin/includes/class-pclzip.php'); $zip = new PclZip($player_package); $archive_files = $zip->extract(PCLZIP_OPT_EXTRACT_AS_STRING); $dir = $archive_files[0]["filename"]; foreach($archive_files as $file) { $result = true; if ($file["filename"] == $dir . "player.swf" || $file["filename"] == $dir . "player-licensed.swf") { $result = @file_put_contents(LongTailFramework::getPrimaryPlayerPath(), $file["content"]); if (!$result) { return WRITE_ERROR; } $player_found = true; } else if ($file["filename"] == $dir . "yt.swf") { $result = @file_put_contents(str_replace("player.swf", "yt.swf", LongTailFramework::getPrimaryPlayerPath()), $file["content"]); if (!$result) { return WRITE_ERROR; } } else if ($file["filename"] == $dir . "jwplayer.js") { $result = @file_put_contents(LongTailFramework::getEmbedderPath(), $file["content"]); if (!$result) { return WRITE_ERROR; } } } if ($player_found) { unlink($player_package); return SUCCESS; } return ZIP_ERROR; } function player_download() { $player_package = download_url("http://www.longtailvideo.com/wp/jwplayer.zip"); if (is_wp_error($player_package)) { return DOWNLOAD_ERROR; } return unpack_player_archive($player_package); } function player_upload() { return unpack_player_archive($_FILES["file"]["tmp_name"]); } function default_state() { ?>

upgrade page."; ?>

" method="post" action="">
If you already have the JW Player then you can install it using the upgrade page.
Alternatively you may FTP the player files directly to your site. Place the player.swf and jwplayer.js files in " . JWPLAYER_FILES_DIR . "/player/.
" . JW_FILE_PERMISSIONS); } else if ($result == WRITE_ERROR) { error_message("Not able to install JW Player. Please make sure the " . JWPLAYER_FILES_DIR . "/player/ directory exists (and is writabe) and then visit the upgrade page.
Alternatively you may FTP the player.swf and jwplayer.js files directly to your site.
" . JW_FILE_PERMISSIONS); } else if ($result == ZIP_ERROR) { error_message("The necessary zip classes are missing. Please FTP the player manually.
Place the player.swf and jwplayer.js files in " . JWPLAYER_FILES_DIR . "/player/."); } else if ($result == READ_ERROR) { error_message("Could not find player.swf or jwplayer.js. Either they are not present or the archive is invalid.
Alternatively you may FTP the player files directly to your site. Place the player.swf and jwplayer.js files in " . JWPLAYER_FILES_DIR . "/player/."); } } function upload_state() { ?>

" method="post" action="">
upgrade page. " . JW_FILE_PERMISSIONS); default_state(); } else if ($result == ZIP_ERROR) { error_message("The necessary zip classes are missing. Please upload the player manually instead using the upgrade page."); default_state(); } else if ($result == READ_ERROR) { error_message("Could not find player.swf or yt.swf. Either they are not present or the archive is invalid."); default_state(); } else { error_message("Not a valid zip archive."); default_state(); } } function error_message($message) { ?>

"http://content.longtailvideo.com/videos/bunny.flv", "image" => "http://content.longtailvideo.com/videos/bunny.jpg", "id" => "jwplayer-1" ); wp_print_scripts('swfobject'); $swf = LongTailFramework::generateSWFObject($atts, false); ?> generateEmbedScript(); ?>
" method="post" action="" enctype="multipart/form-data" onsubmit="return fileValidation();">

LongTail Video."; ?>

" method="post" action="">