This patch adds support for embedding playlists, and choosing which player should be the default playlist player. It also adds support for selecting what embed parameter (@videoPlayer, @videoTabs, etc) a player should use.

Note that this patch requires the patch for Media 2.x integration here: http://drupal.org/node/1307886#comment-7263472. I understand that the module maintainers are working on a different version for Media 2.x, but I needed this functionality so I had to use that patch for now.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

theunraveler’s picture

Here's another pass at this that fixes a couple things:

1. Recognizes playlists embedded with Brightcove short URLs.
2. Recognizes more types of playlist embed codes (@playlistCombo, @videoList).
3. Fixes media browser thumbnails for playlists.

dalin’s picture

Status: Active » Needs work

in the update function:

if (!db_field_exists('brightcove_player', 'param')) {
  $schema = brightcove_schema();
  db_add_field('brightcove_player', 'param', $schema['brightcove_player']['fields']['embed'] + array( 

We're adding a column called 'param', but in the schema we call it 'embed'. But this also brings up the issue that the name is a bit ambiguous. Can we instead call it (and the corresponding occurrences elsewhere in the patch) 'embed_parameter'.

-  // Perform basic extension check.
+  // Perform basic extension check,

???

       $resp = drupal_http_request($embedCode);
       if ($resp) {
-        $full_url = $resp->redirect_url;
-        $matches = NULL;
-        preg_match('#&bctid=([0-9]+)#i', $full_url, $matches);
-        if (isset($matches[1])) {
-          return file_stream_wrapper_uri_normalize(
-            "brightcove://{$matches[1]}");
-        }
+        $embedCode = $resp->redirect_url;
       }

This might be too much of an assumption. How about if ($resp && !empty($resp->redirect_url)) {

    $array = unserialize($setting->settings);
    if (!empty($array) && is_array($array)) {
      $array['video_player'] = $array['player'];
      unset($array['player']);
      $setting->settings = $array;
      drupal_write_record('file_display', $setting, 'name');
    }

I don't think this will work. there's an unserialize, but it doesn't get re-serialized.

+      '#video_id' => str_replace('/', '', parse_url($file->uri, PHP_URL_PATH)),

Is there any way to call the stream wrapper instead, because this is slightly different than its logic. May as well get $type that way too.

Otherwise this is great. Good to see that this could be done without making a new bundle of the File entity type (which might've broken other stuff in the Drupalverse that assumes videos are videos).

theunraveler’s picture

I don't think this will work. there's an unserialize, but it doesn't get re-serialized.

drupal_write_record() takes care of the re-serializing.

All of the other issues should be fixed in this patch.

Note: if you applied the previous patch, you'll either need to re-install the module, manually change the "param" database column, or set this module's schema_version to 7005 and run update.php (I changed the name of the "param" column to "embed_parameter").

dalin’s picture

Status: Needs work » Needs review

Marking this as "needs review" since it probably needs to be tested in a wider diversity of environments. But technically I think this is sound.

theunraveler’s picture

Small fix for thumbnails in the media browser search dialog.

k.dani’s picture

Version: 7.x-3.x-dev » 7.x-5.x-dev
Issue summary: View changes

Only version 5 of the module will be supported in the future, so i move the issue to this version.

jan.mashat’s picture

Status: Needs review » Closed (won't fix)
Issue tags: +unsupported

This version of the module is no longer supported. Only the latest 2 major versions are supported, which are currently 8.x-1.x and 7.x-6.x. Therefore I'm tagging this issue as 'unsupported' and closing it (won't fix). If this feature is business critical for your organization, please contact your Brightcove account manager for further support.