Moodle
  1. Moodle
  2. MDL-7549

Flash MP3 Player sometimes doesn't play final microsecond.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Won't Fix
    • Affects Version/s: 1.6.3
    • Fix Version/s: 1.6.9+, 1.9.6
    • Component/s: Other
    • Labels:
      None
    • Affected Branches:
      MOODLE_16_STABLE
    • Fixed Branches:
      MOODLE_16_STABLE, MOODLE_19_STABLE
    • Rank:
      27769

      Description

      Flash MP3 Player Bug Report:

      When playing the following file, the last word does not get played when using the small MP3 player.

      http://www.cdlponline.org/audioFiles/99_basic.mp3

      ..../filter/mediaplugin/mp3player.swf?src=http://www.cdlponline.org/audioFiles/99_basic.mp3

      Note that the Flash player on their page plays the file completely, so it doesn't seem to be a problem with the MP3 file or with Flash.
      http://www.cdlponline.org/index.cfm?fuseaction=activity1&topicID=8&storyID=99

      1. 1-2.mp3
        3.51 MB
        Adi Tedjasaputra
      2. mp3player.swf
        2 kB
        derrida316

        Activity

        Hide
        derrida316 added a comment -

        I ran into this problem as well, where the MP3 player cut off the end of the audio. I only changed Lines 65 & 66 in the ActionScript, and it took care of the problem, but more testing would be needed to determine if other problems were created. However, my sound files play through to the end now, which is what I needed. If this is helpful to the wider community, I'm glad to be of service.

        Show
        derrida316 added a comment - I ran into this problem as well, where the MP3 player cut off the end of the audio. I only changed Lines 65 & 66 in the ActionScript, and it took care of the problem, but more testing would be needed to determine if other problems were created. However, my sound files play through to the end now, which is what I needed. If this is helpful to the wider community, I'm glad to be of service.
        Hide
        Martin Dougiamas added a comment -

        Thanks Peter!

        Jerome can you generate/review the diff and commit?

        Show
        Martin Dougiamas added a comment - Thanks Peter! Jerome can you generate/review the diff and commit?
        Hide
        Jérôme Mouneyrac added a comment -

        Hi, how did you test a microsecond?
        On the file given in the introduction, I can hear all well. I tested on 1.6 and 1.9

        Show
        Jérôme Mouneyrac added a comment - Hi, how did you test a microsecond? On the file given in the introduction, I can hear all well. I tested on 1.6 and 1.9
        Hide
        Jérôme Mouneyrac added a comment - - edited

        If someone can reproduce, don't hesitate to reopen this issue again.
        Thanks Charles and Peter for the report and the fix.

        Show
        Jérôme Mouneyrac added a comment - - edited If someone can reproduce, don't hesitate to reopen this issue again. Thanks Charles and Peter for the report and the fix.
        Hide
        derrida316 added a comment -

        Hi Jerome. I think "microsecond" was a bit of an exaggeration...lol. The MP3 player was cutting off the last word or two, the same problem reported on this thread: http://moodle.org/mod/forum/discuss.php?d=51595; in the example given in this post (http://moodle.org/mod/forum/discuss.php?d=51595#p430679), you can hear how the entire last sentence of the MP3 is cut off by the player. This problem was caused by the original Flash coding resetting and pausing when the playhead reached the end, not when the audio was finished. I suspect there is a problem with the original coding not factoring in the buffer time, but it doesn't matter because the playhead reaching the end is not as accurate as when the audio file itself reaches the end. My code removes checking when the playhead reaches the end. Instead, the MP3 player resets and pauses when the audio file itself is finished.

        Show
        derrida316 added a comment - Hi Jerome. I think "microsecond" was a bit of an exaggeration...lol. The MP3 player was cutting off the last word or two, the same problem reported on this thread: http://moodle.org/mod/forum/discuss.php?d=51595 ; in the example given in this post ( http://moodle.org/mod/forum/discuss.php?d=51595#p430679 ), you can hear how the entire last sentence of the MP3 is cut off by the player. This problem was caused by the original Flash coding resetting and pausing when the playhead reached the end, not when the audio was finished. I suspect there is a problem with the original coding not factoring in the buffer time, but it doesn't matter because the playhead reaching the end is not as accurate as when the audio file itself reaches the end. My code removes checking when the playhead reaches the end. Instead, the MP3 player resets and pauses when the audio file itself is finished.
        Hide
        Jérôme Mouneyrac added a comment -

        ok I confirm the bug

        Show
        Jérôme Mouneyrac added a comment - ok I confirm the bug
        Hide
        Jérôme Mouneyrac added a comment -

        Here is the Action Script diff for the Peter's patch:

        if (playMode == "play") {
        slider.handle._x = s.position / s.duration * slider.track._width;
        // if we've reached the end of the file

        • if (Math.round(slider.handle._x) == Math.round(slider.track._width)) {
          + s.onSoundComplete = function()
          + { // reset the slider to the beginning and pause slider.handle._x = 0; pauseBtn.onPress(); }

          }

        Ii looks and sounds find to me. I'll do a bit more tests and I'll commit it.

        Show
        Jérôme Mouneyrac added a comment - Here is the Action Script diff for the Peter's patch: if (playMode == "play") { slider.handle._x = s.position / s.duration * slider.track._width; // if we've reached the end of the file if (Math.round(slider.handle._x) == Math.round(slider.track._width)) { + s.onSoundComplete = function() + { // reset the slider to the beginning and pause slider.handle._x = 0; pauseBtn.onPress(); } } Ii looks and sounds find to me. I'll do a bit more tests and I'll commit it.
        Hide
        Jérôme Mouneyrac added a comment -

        I added Peter's fix to the flash player. Note that I saved the new fla file under CS3 format. I also republished the swf file with flash CS4.
        Thanks Peter for the fix

        Show
        Jérôme Mouneyrac added a comment - I added Peter's fix to the flash player. Note that I saved the new fla file under CS3 format. I also republished the swf file with flash CS4. Thanks Peter for the fix
        Hide
        Jérôme Mouneyrac added a comment -

        It has been committed on 1.6, 1.7, 1.8, 1.9 and HEAD

        Show
        Jérôme Mouneyrac added a comment - It has been committed on 1.6, 1.7, 1.8, 1.9 and HEAD
        Hide
        Helen Foster added a comment -

        Charles, thanks for reporting this issue, and Peter, thanks again for your fix. Jerome, thanks for applying the fix

        It works perfectly for me (testing with the latest 1.9.4+).

        Show
        Helen Foster added a comment - Charles, thanks for reporting this issue, and Peter, thanks again for your fix. Jerome, thanks for applying the fix It works perfectly for me (testing with the latest 1.9.4+).
        Hide
        Helen Foster added a comment -

        Reopening this issue following a report of the problem occurring in Moodle 1.9.5:

        http://moodle.org/mod/forum/discuss.php?d=129899

        Show
        Helen Foster added a comment - Reopening this issue following a report of the problem occurring in Moodle 1.9.5: http://moodle.org/mod/forum/discuss.php?d=129899
        Hide
        Jérôme Mouneyrac added a comment -

        Hi,
        I retested the small and big player on a fresh install of the latest 1.9, it works well.
        Please if anyone has still a problem, attach the concerned mp3 to this issue and describe what's the missing words. Also indicate accurately where you display the small player. Thank you.

        Show
        Jérôme Mouneyrac added a comment - Hi, I retested the small and big player on a fresh install of the latest 1.9, it works well. Please if anyone has still a problem, attach the concerned mp3 to this issue and describe what's the missing words. Also indicate accurately where you display the small player. Thank you.
        Hide
        Jérôme Mouneyrac added a comment -

        Dom just reported to me it was still not working. I tested, Helen retested. It could be a Flash player problem... please let me know your flash player version number. retesting with the last 1.9, I'll let you know...

        Show
        Jérôme Mouneyrac added a comment - Dom just reported to me it was still not working. I tested, Helen retested. It could be a Flash player problem... please let me know your flash player version number. retesting with the last 1.9, I'll let you know...
        Hide
        Jérôme Mouneyrac added a comment -

        I retested with latest 1.9 from cvs with small and big flash player, the MP3 is played entirely. My flash player version is: 10,1,102,64
        I use MacOS X.

        Show
        Jérôme Mouneyrac added a comment - I retested with latest 1.9 from cvs with small and big flash player, the MP3 is played entirely. My flash player version is: 10,1,102,64 I use MacOS X.
        Hide
        Adi Tedjasaputra added a comment -

        Please kindly investigate against this file. Thanks

        Show
        Adi Tedjasaputra added a comment - Please kindly investigate against this file. Thanks
        Hide
        Jérôme Mouneyrac added a comment -

        Hi,
        I've just tested the attached file with the big flash player, I confirm I can't hear the end of the music in a resource file (it works for the small player in a forum). It seems like the issue appears only on certain mp3. I reopen this issue.

        Show
        Jérôme Mouneyrac added a comment - Hi, I've just tested the attached file with the big flash player, I confirm I can't hear the end of the music in a resource file (it works for the small player in a forum). It seems like the issue appears only on certain mp3. I reopen this issue.
        Hide
        Jérôme Mouneyrac added a comment -

        Reassigned to nobody. Any Flash contribution will be appreciated.

        If someone attach a patch, I'll review it (please comment your Flash code for a beginner ). In this case reassign the issue to me when you attach the patch. Thank you.

        Show
        Jérôme Mouneyrac added a comment - Reassigned to nobody. Any Flash contribution will be appreciated. If someone attach a patch, I'll review it (please comment your Flash code for a beginner ). In this case reassign the issue to me when you attach the patch. Thank you.
        Hide
        Michael de Raadt added a comment -

        Thanks for reporting this issue.

        We have detected that this issue has been inactive for over a year has been recorded as affecting versions that are no longer supported.

        If you believe that this issue is still relevant to current versions (2.1 and beyond), please comment on the issue. Issues left inactive for a further month will be closed.

        Michael d;

        lqjjLKA0p6

        Show
        Michael de Raadt added a comment - Thanks for reporting this issue. We have detected that this issue has been inactive for over a year has been recorded as affecting versions that are no longer supported. If you believe that this issue is still relevant to current versions (2.1 and beyond), please comment on the issue. Issues left inactive for a further month will be closed. Michael d; lqjjLKA0p6
        Hide
        Michael de Raadt added a comment -

        I'm closing this issue as it has become inactive and does not appear to affect a current supported version. If you are encountering this problem or one similar, please launch a new issue.

        Show
        Michael de Raadt added a comment - I'm closing this issue as it has become inactive and does not appear to affect a current supported version. If you are encountering this problem or one similar, please launch a new issue.

          People

          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: