$secure_html5_video_player_video_dir = get_option('secure_html5_video_player_video_dir'); $filedir = $secure_html5_video_player_video_dir; $last_slash_pos = strrpos($filename, '/'); if ($last_slash_pos !== FALSE) { $filedir .= '/' . substr($filename, 0, $last_slash_pos); $filename = substr($filename, $last_slash_pos + 1); $filepath = $secure_html5_video_player_video_dir . '/' . $filename; $filename_no_ext = secure_html5_video_player_filename_no_ext($filename); } if (is_dir($filedir)) { $dh = opendir($filedir); while (false !== ($curr_video_file = readdir($dh))) { if (secure_html5_video_player_startsWith($curr_video_file, '.')) { continue; } $ext = secure_html5_video_player_filename_get_ext($curr_video_file); $normalized_ext = secure_html5_video_player_filename_get_normalized_ext($ext); $start_check = $filename_no_ext . '.'; if (secure_html5_video_player_startsWith($curr_video_file, $start_check)) { print $normalized_ext . '=' . secure_html5_video_player_media_url($secure_html5_video_player_video_dir, $plugin_dir, $access_key, $original_filename_no_ext, $ext) . "\n"; $found = true; } } } if (!$found) { print '0'; } } else { if ($info == 'list') { $video_files = secure_html5_video_player_filelist(false); foreach ($video_files as $curr_video_file => $server_addr) {
function secure_html5_video_player_filename_normalized_ext($str) { $filename_no_ext = secure_html5_video_player_filename_no_ext($str); $ext = secure_html5_video_player_filename_get_ext($str); $normalized_ext = secure_html5_video_player_filename_get_normalized_ext($ext); return $filename_no_ext . '.' . $normalized_ext; }