Moodle
  1. Moodle
  2. MDL-32310

mediaplugin mp3 player not shown in chrome

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2
    • Fix Version/s: 2.2.5, 2.3.2
    • Component/s: Filters
    • Labels:
    • Testing Instructions:
      Hide
      1. Enable the multimedia filter
      2. Use chrome
      3. Add/ enable the screenshot extension (https://chrome.google.com/webstore/detail/cpngackimfmofbokmjmljamhdncknpmg)
      4. Create a forum post and use the add media button to add an mp3
      5. View your forum post
      6. The forum post should contain the little flash media player (NOTE: on my chrome when it was breaking it was falling back to the OSX inbuilt media player, however this would break badly in other oses)
      Show
      Enable the multimedia filter Use chrome Add/ enable the screenshot extension ( https://chrome.google.com/webstore/detail/cpngackimfmofbokmjmljamhdncknpmg ) Create a forum post and use the add media button to add an mp3 View your forum post The forum post should contain the little flash media player (NOTE: on my chrome when it was breaking it was falling back to the OSX inbuilt media player, however this would break badly in other oses)
    • Affected Branches:
      MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE
    • Pull Master Branch:
    • Rank:
      39119

      Description

      When loading a page with an mp3 file and mediaplugin enabled, chrome is not displaying the player.
      Looking at the chrome javascript console it seems to be because of the way document.styleSheet is iterated.
      Each rule is tested like this:

      typeof (document.styleSheets[j].rules) != 'undefined'

      but in chrome the last .rules is = null. A simple check can deal with this:

      if (!allrules) continue;

      (after the "if" and before the "for").

      1. javascript-static.js.patch
        2 kB
        Esben Sune Rasmussen
      1. dump.jpg
        61 kB

        Issue Links

          Activity

          Hide
          Michael de Raadt added a comment -

          Hi, Esben.

          I am able to see a player for an mp3 file in Chrome.

          Your improvement may have merit, but perhaps you could provide more detail so we could reproduce the problem. What steps could we follow to experience this problem?

          Show
          Michael de Raadt added a comment - Hi, Esben. I am able to see a player for an mp3 file in Chrome. Your improvement may have merit, but perhaps you could provide more detail so we could reproduce the problem. What steps could we follow to experience this problem?
          Hide
          Esben Sune Rasmussen added a comment -

          I just tried reseting my moodle (git clean -f -d).
          I have added a forum, then a discussion and at last a reply to that discussion.
          In the reply i have added a MP3 attachment called "Music Copy.mp3".
          Then i open the discussion again, and i only get the link to the mp3 (not the media player).

          I'm running Windows 7 64-bit, with XAMPP 1.7.7 (PHP 5.3.8).
          The Moodle installation i'm using is latest git origin/MOODLE_22_STABLE (b1d3043).

          Chrome is 18.0.1025.162 m

          I've only enabled the multimedia plugin, and left it at the default conf.

          Show
          Esben Sune Rasmussen added a comment - I just tried reseting my moodle (git clean -f -d). I have added a forum, then a discussion and at last a reply to that discussion. In the reply i have added a MP3 attachment called "Music Copy.mp3". Then i open the discussion again, and i only get the link to the mp3 (not the media player). I'm running Windows 7 64-bit, with XAMPP 1.7.7 (PHP 5.3.8). The Moodle installation i'm using is latest git origin/MOODLE_22_STABLE (b1d3043). Chrome is 18.0.1025.162 m I've only enabled the multimedia plugin, and left it at the default conf.
          Hide
          Michael de Raadt added a comment -

          Thanks for adding more to this issue.

          Another issue was reported which does attempt to explain this behaviour. A patch is also supplied with that issue and it may be worth looking at.

          Show
          Michael de Raadt added a comment - Thanks for adding more to this issue. Another issue was reported which does attempt to explain this behaviour. A patch is also supplied with that issue and it may be worth looking at.
          Hide
          Paul Nicholls added a comment - - edited

          Added pull details from duplicate ticket (MDL-32582). These implement the 1-line fix now mentioned in the description (if (!allrules) continue; ) and should apply cleanly to all branches.

          Show
          Paul Nicholls added a comment - - edited Added pull details from duplicate ticket ( MDL-32582 ). These implement the 1-line fix now mentioned in the description (if (!allrules) continue; ) and should apply cleanly to all branches.
          Hide
          Paul Nicholls added a comment -

          Hi Michael (and/or Eloy),
          Any chance of this being dealt with before 2.3 is released? Now that 2.3 has the media stuff as part of core rather than the filter, it's potentially a bigger issue (since other modules, including 3rd party ones, can start to use it). Since the affected code is still in javascript-static.js, I imagine my patches ought to still apply cleanly (though I haven't confirmed).

          Show
          Paul Nicholls added a comment - Hi Michael (and/or Eloy), Any chance of this being dealt with before 2.3 is released? Now that 2.3 has the media stuff as part of core rather than the filter, it's potentially a bigger issue (since other modules, including 3rd party ones, can start to use it). Since the affected code is still in javascript-static.js, I imagine my patches ought to still apply cleanly (though I haven't confirmed).
          Hide
          Dan Poltawski added a comment -

          I've tested this out, it was a little awkard because when it was breaking the oSX inbuilt player would come up instead. but confirmed that this fixes the issue.

          Submitting for integration.

          Show
          Dan Poltawski added a comment - I've tested this out, it was a little awkard because when it was breaking the oSX inbuilt player would come up instead. but confirmed that this fixes the issue. Submitting for integration.
          Hide
          Dan Poltawski added a comment -

          Thanks for the patch, Paul.

          I've rebased and submitting yor patch for integration.

          Show
          Dan Poltawski added a comment - Thanks for the patch, Paul. I've rebased and submitting yor patch for integration.
          Hide
          Dan Poltawski added a comment -

          The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week.

          TIA and ciao

          Show
          Dan Poltawski added a comment - The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week. TIA and ciao
          Hide
          Sam Hemelryk added a comment -

          Thanks guys, this has been integrated now

          Show
          Sam Hemelryk added a comment - Thanks guys, this has been integrated now
          Hide
          Sam Hemelryk added a comment -

          Ah just found a duplicate of this issue in integration as well MDL-30876.
          There fix goes a little further and introduces a try...catch.
          Dan when testing this did you find any browsers that would throw exceptions?

          Cheers
          Sam

          Show
          Sam Hemelryk added a comment - Ah just found a duplicate of this issue in integration as well MDL-30876 . There fix goes a little further and introduces a try...catch. Dan when testing this did you find any browsers that would throw exceptions? Cheers Sam
          Hide
          Dan Poltawski added a comment -

          I didn't, but probably didn't look very hard.

          Show
          Dan Poltawski added a comment - I didn't, but probably didn't look very hard.
          Hide
          Ankit Agarwal added a comment -

          works as expected!

          Show
          Ankit Agarwal added a comment - works as expected!
          Hide
          Dan Poltawski added a comment -

          *Notice*: Undefined variable: friendlyintegrator in /Users/danp/git/tokenintegrationthanks.php on line 26

          Congratulations

          {tracker.user.name}

          !

          You've made into Moodle

          {tracker.fixversion-1}

          +

          I would like to personally thank you for this contribution on behalf of all Moodle users throughout the world.

          cheers!

          {tracker.friendlyintegrator}
          Show
          Dan Poltawski added a comment - * Notice *: Undefined variable: friendlyintegrator in /Users/danp/git/tokenintegrationthanks.php on line 26 Congratulations {tracker.user.name} ! You've made into Moodle {tracker.fixversion-1} + I would like to personally thank you for this contribution on behalf of all Moodle users throughout the world. cheers! {tracker.friendlyintegrator}

            People

            • Votes:
              2 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: