Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply audio durations to scope immediately upon their availability #1514

Merged
merged 1 commit into from
Oct 5, 2022

Conversation

laineyhm
Copy link
Collaborator

@laineyhm laineyhm commented Oct 5, 2022

Fixes #1512

Description

With our AngularJS bindings, the duration of an audio file is not displayed unless it has been loaded. Previously, the DOM was not being updated immediately upon the duration becoming available. This PR tells the $scope to apply its changes to the DOM once the "durationchange" event has occurred on the HTML audio element.

Because it takes a small amount of time for the duration to become available, there is still visible movement; there is a split second from when the entry is clicked on and the duration is not there, to when the duration appears.

Type of Change

  • UI change

Screenshots

Before, I was able to reproduce Chris's bug video in issue #1512, for me on Windows 10 with Google Chrome. Now I am seeing this:

video1546811699.mp4

A potential concern of mine is that the quick flash when the duration appears might be considered unpleasant to look at. But, I am not sure I can make it appear with zero delay, since our code already says the duration should appear if it's available, the instant you had clicked it.

Checklist

  • I have performed a self-review of my own code
  • I have reviewed the title/description of this PR which will be used as the squashed PR commit message
  • I have commented my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works

How to test

  • Load the page. See if an entry's audio duration appears right after you load the page.
  • Click on some entries with audio. See if the audio duration appears right after you click on it.
  • Upload an audio file. See if the audio duration displays right after the upload completes.
  • Record an audio segment. See if the audio duration displays right after the upload completes.

qa.languageforge.org testing

Testers: Check the box and put in a date/time to sign-off/attest the feature works as expected on qa.languageforge.org

  • Billy (2022-10-05)

durations were visible for entries with audio already (pretty quickly)

durations were visible for newly recorded audio

durations were visible for newly uploaded audio

  • Tester2 (YYYY-MM-DD HH:MM)

@github-actions
Copy link

github-actions bot commented Oct 5, 2022

Unit Test Results

368 tests   368 ✔️  11s ⏱️
    1 suites      0 💤
    1 files        0

Results for commit 9c9a6b7.

Copy link
Collaborator

@megahirt megahirt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow! Nailed it! Well done.

@longrunningprocess longrunningprocess merged commit 399065f into develop Oct 5, 2022
@longrunningprocess longrunningprocess deleted the consistently-display-durations branch October 5, 2022 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: audio length in playback does not reliably display on page load or when switching entries
3 participants