diff -urpN ./media.module ../media/media.module
--- ./media.module	2011-02-10 18:19:18.000000000 -0600
+++ ../media/media.module	2011-02-10 18:19:10.000000000 -0600
@@ -1219,3 +1219,11 @@ function media_flush_caches() {
   db_delete('media_filter_usage')->condition('timestamp', REQUEST_TIME - 86400 * 120, '<')->execute();
 }
 
+/**
+ * Implements hook_ctools_plugin_directory().
+ */
+function media_ctools_plugin_directory($module, $plugin) {
+  if ($module == 'page_manager' || $module == 'ctools') {
+    return 'plugins/' . $plugin;
+  }
+}
diff -urpN ./plugins/tasks/media_view.inc ../media/plugins/tasks/media_view.inc
--- ./plugins/tasks/media_view.inc	1969-12-31 18:00:00.000000000 -0600
+++ ../media/plugins/tasks/media_view.inc	2011-02-10 18:26:17.000000000 -0600
@@ -0,0 +1,144 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Handle the 'media view' override task.
+ *
+ * This plugin overrides media/%media and reroutes it to the page manager, where
+ * a list of tasks can be used to service this request based upon criteria
+ * supplied by access plugins.
+ */
+
+/**
+ * Specialized implementation of hook_page_manager_task_tasks(). See api-task.html for
+ * more information.
+ */
+function media_media_view_page_manager_tasks() {
+  return array(
+    // This is a 'page' task and will fall under the page admin UI
+    'task type' => 'page',
+
+    'title' => t('Media template'),
+
+    'admin title' => t('Media template'),
+    'admin description' => t('When enabled, this overrides the default Drupal behavior for displaying media at <em>media/%media</em>. If you add variants, you may use selection criteria such as media bundle or language or user access to provide different views of media files. If no variant is selected, the default Drupal media view will be used. This page only affects media viewed as pages, it will not affect media viewed in lists or at other locations.'),
+    'admin path' => 'media/%media',
+
+    // Menu hooks so that we can alter the media/%media menu entry to point to us.
+    'hook menu' => 'media_media_view_menu',
+    'hook menu alter' => 'media_media_view_menu_alter',
+
+    // This is task uses 'context' handlers and must implement these to give the
+    // handler data it needs.
+    'handler type' => 'context',
+    'get arguments' => 'media_media_view_get_arguments',
+    'get context placeholders' => 'media_media_view_get_contexts',
+
+    // Allow this to be enabled or disabled:
+    'disabled' => variable_get('media_media_view_disabled', TRUE),
+    'enable callback' => 'media_media_view_enable',
+  );
+}
+
+/**
+ * Callback defined by media_media_view_page_manager_tasks().
+ *
+ * Alter the media view input so that media view comes to us rather than the
+ * normal media view process.
+ */
+function media_media_view_menu_alter(&$items, $task) {
+  if (variable_get('media_media_view_disabled', TRUE)) {
+    return;
+  }
+
+  // Override the media view handler for our purpose.
+  $callback = $items['media/%media']['page callback'];
+  if ($callback == 'media_file_view' || variable_get('page_manager_override_anyway', FALSE)) {
+    $items['media/%media']['page callback'] = 'media_media_view_page';
+    $items['media/%media']['file path'] = $task['path'];
+    $items['media/%media']['file'] = $task['file'];
+  }
+  else {
+    // automatically disable this task if it cannot be enabled.
+    variable_set('media_media_view_disabled', TRUE);
+    if (!empty($GLOBALS['media_enabling_media_view'])) {
+      drupal_set_message(t('Page manager module is unable to enable media/%media because some other module already has overridden with %callback.', array('%callback' => $callback)), 'error');
+    }
+  }
+}
+
+/**
+ * Entry point for our overridden media view.
+ *
+ * This function asks its assigned handlers who, if anyone, would like
+ * to run with it. If no one does, it passes through to Drupal core's
+ * media view, which is media_file_view().
+ */
+function media_media_view_page($file) {
+  // Load my task plugin
+  $task = page_manager_get_task('media_view');
+
+  // Load the media into a context.
+  ctools_include('context');
+  ctools_include('context-task-handler');
+  $contexts = ctools_context_handler_get_task_contexts($task, '', array($file));
+
+  $output = ctools_context_handler_render($task, '', $contexts, array($file->fid));
+  if ($output != FALSE) {
+    return $output;
+  }
+
+  $function = 'media_file_view';
+  foreach (module_implements('page_manager_override') as $module) {
+    $call = $module . '_page_manager_override';
+    if (($rc = $call('media_view')) && function_exists($rc)) {
+      $function = $rc;
+      break;
+    }
+  }
+
+  // Otherwise, fall back.
+  if ($function == 'media_file_view') {
+    module_load_include('inc', 'media', 'media.pages');
+  }
+  return $function($file);
+}
+
+/**
+ * Callback to get arguments provided by this task handler.
+ *
+ * Since this is the media view and there is no UI on the arguments, we
+ * create dummy arguments that contain the needed data.
+ */
+function media_media_view_get_arguments($task, $subtask_id) {
+  return array(
+    array(
+      'keyword' => 'media',
+      'identifier' => t('Media being viewed'),
+      'id' => 1,
+      'name' => 'entity_id:media',
+      'settings' => array(),
+    ),
+  );
+}
+
+/**
+ * Callback to get context placeholders provided by this handler.
+ */
+function media_media_view_get_contexts($task, $subtask_id) {
+  return ctools_context_get_placeholders_from_argument(media_media_view_get_arguments($task, $subtask_id));
+}
+
+/**
+ * Callback to enable/disable the page from the UI.
+ */
+function media_media_view_enable($cache, $status) {
+  variable_set('media_media_view_disabled', $status);
+
+  // Set a global flag so that the menu routine knows it needs
+  // to set a message if enabling cannot be done.
+  if (!$status) {
+    $GLOBALS['media_enabling_media_view'] = TRUE;
+  }
+}
