Hi there,
I had some problem getting jPlayer working in conjunction with jplayer_protect.

The problem

On Safari (5.1.7) the player didn't start but I was getting logged in the jplayer_protect_denied-table.

The environment:

- drupal-7.18
- jplayer-7.x-2.x-dev (2012-Jun-19)
- jPlayer library 2.0.0
- single_mode-1780386-3.patch
- jplayer-wrong_table_name-1651076-2.patch
- id_error-1843644-1.patch
- custom skin (responsive)

The setup:

- Different filefields on different content types.
- Displayed as field formatter; single instance.
- Used file format: MP3.

Other contributed modules (maybe) affecting:

- private_files_download_permission-7.x-2.1
I hacked this module allowing any file request when specific path-argument's are given (like styles and those relating to the audio files). As far as I understand this is all working fine and not causing any problems, but maybe I'm wrong.

My (dirty, hacked) solution:

After some debugging I realized that within the jplayer_protect_file_download()-function the $started-variable does never contain any value when I'm browsing with Safari.
So I altered the following code:

    if (isset($_SESSION['jplayer_protect'][$encoded_access_key])) {
      $access_key = $encoded_access_key;
      $started = (int)$_SESSION['jplayer_protect'][$access_key];
    }

...into...

    if (isset($_SESSION['jplayer_protect'][$encoded_access_key])) {
      $access_key = $encoded_access_key;
      $started = (int)$_SESSION['jplayer_protect'][$access_key];
    } else {
      $started = REQUEST_TIME;
    }

For me this did the trick: jPlayer does now play in any browser, even Safari.
And direct access on the audio files is prevented.

Can anybody confirm this problem/fix?
Am I doing wrong this way/Is there a better way?

Comments

markie’s picture

Status: Needs review » Closed (outdated)

jplayer-7.x-2.0 has been released. Please verify this is still an issue and open a new issue against that build or update this issue.