Is this module currently compatible with JW Player 7 (JW7)?

There is an official webinar coming up soon:
Thursday, August 13, 2015 1:00 PM EDT
https://goto.webcasts.com/starthere.jsp?ei=1073488

Seven Reasons to Use JW7

Thu, Aug 13, 2015 1:00 PM EDT
Please join us as we give an overview of all of the new features and benefits JW Player has included in JW7 -- our fastest, smartest, and most customizable player yet. JW7 was reengineered from the core API to the visual interface to provide the best online video experience no matter what device, browser, and rendering mode is used to play your content.

We will showcase JW7's:

  • MPEG-DASH support
  • Skins completely customizable with CSS
  • Faster: loading -- 35% over JW6 --, video rendering, and development and integration
  • Flash behind the scenes with a Javascript and HTML5-based player
  • Updated embedding

Who Should Attend:

  • Developers and Agencies
  • Publishers and Broadcasters
  • Advertisers and Ad Networks
  • Marketers and Brands

Speaker:

Eric Boyd
Director of Product
JW Player

Comments

deanflory created an issue. See original summary.

seutje’s picture

It's version matching pattern fails miserably.

6 version fails in a whole different way

s_leu’s picture

Status: Active » Needs review
StatusFileSize
new17.11 KB

Here's a first patch that introduces version 7 support and also fixes some out dated config for the cloud hosted player.

s_leu’s picture

Fixed some typo in hook_update.

  • Berdir committed 1c6742a on 7.x-2.x authored by s_leu
    Issue #2548237 by s_leu: Compatibility with JW Player 7 (JW7)?
    
berdir’s picture

Version: 7.x-2.x-dev » 8.x-1.x-dev
Category: Support request » Feature request
Status: Needs review » Patch (to be ported)

Committed, lets move this to 8.x-1.x now.

johnchque’s picture

Assigned: Unassigned » johnchque
Status: Patch (to be ported) » Needs review
StatusFileSize
new19.95 KB

Added first version, also added tests.

berdir’s picture

Status: Needs review » Needs work
  1. +++ b/config/install/jw_player.settings.yml
    @@ -0,0 +1,3 @@
    +jw_player_version: 6
    \ No newline at end of file
    diff --git a/config/jw_player.settings.yml b/config/jw_player.settings.yml
    

    make sure you have a newline at the end, or diff is unhappy.

  2. +++ b/jw_player.install
    @@ -32,3 +32,16 @@ function jw_player_requirements($phase) {
    +  $config->set('jw_player_version', 6);
    +  drupal_set_message(t('JW Player version has been set to 6.'));
    

    almost correct, you just forgot to actually save the configuration changes at the end.

  3. +++ b/jw_player.module
    @@ -266,3 +286,25 @@ function jw_player_library_info_alter(&$libraries, $extension) {
    + * Gets the correct key for the corresponding JW Player version.
    + *
    + * @return string
    + *   The license key as entered in the UI.
    + */
    +function jw_player_get_key() {
    +  $config = \Drupal::config('jw_player.settings');
    +  return jw_player_use_legacy() ? $config->get('jw_player_key') : $config->get('jw_player_key_7');
    

    think about this more, I'm actually not sure that we need to care about storing a different key. You either use one or the other version. Lets just have a single player_key setting and use that.

  4. +++ b/src/Form/JwplayerSettingsForm.php
    @@ -39,23 +39,53 @@ class JwplayerSettingsForm extends ConfigFormBase {
    +    $url = 'https://dashboard.jwplayer.com/#/players/downloads';
    ...
    -    $form['license_key'] = array(
    +    $form['jw_player_cloud_player_default'] = array(
           '#type' => 'textfield',
    

    jw_player_cloud_player_default as a name is a bit strange.

    Lets just use exactly the same their UI, which is "Cloud Player Library Url". Both in the #title and the name (lowercased)

  5. +++ b/src/Form/JwplayerSettingsForm.php
    @@ -39,23 +39,53 @@ class JwplayerSettingsForm extends ConfigFormBase {
    +    $form['jw_player_key_7'] = array(
           '#type' => 'textfield',
    -      '#title' => $this->t('Cloud-Hosted Account Token'),
    -      '#description' => $this->t('Set the account token for a Cloud-Hosted Player, or leave empty if using a Self-Hosted Player. You can retrieve your token from <a href="@url">your account settings page at jwplayer.com</a>.', array(
    +      '#title' => $this->t('Self-Hosted Player License Key (version 7.x)'),
    +      '#description' => $this->t('Enter your key here. You can retrieve your license key from <a href="@url" target="_blank">your downloads page at jwplayer.com</a>.', array(
    

    then we no longer need this.

johnchque’s picture

Status: Needs work » Needs review
StatusFileSize
new7.88 KB
new18.89 KB

Changes made based on comment #8. Also extended the tests a bit.

berdir’s picture

+++ b/src/Tests/JwPlayer7ConfigurationTest.php
@@ -64,7 +64,7 @@ class JwPlayer7ConfigurationTest extends WebTestBase {
     // Add a random "Cloud-Hosted Account Token".
     $edit = [
-      'jw_player_cloud_player_default' => $token = 'https://content.jwplatform.com/libraries/' . $this->randomMachineName(8) . '.js',
+      'cloud_player_library_url' => $token = 'https://content.jwplatform.com/libraries/' . $this->randomMachineName(8) . '.js',
       'jw_player_version' => 7,

the comment here is outdated, it isn't an account token anymore.

johnchque’s picture

So true, also changed some other lines. :)

  • Berdir committed 82c478b on 8.x-1.x authored by yongt9412
    Issue #2548237 by yongt9412, s_leu: Compatibility with JW Player 7 (JW7...
berdir’s picture

Title: Compatibility with JW Player 7 (JW7)? » Compatibility with JW Player 7 (JW7)
Status: Needs review » Fixed

Indeed. looks good now to me, committed and pushed.

  • Berdir committed e26f009 on 8.x-1.x
    Issue #2548237 by Berdir: Fixed incorrect check for cloud hosted key
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.