Page MenuHomePhabricator

Add a buffer animation to the play button while the sound is loading
Closed, ResolvedPublic

Description

It would be good to have some kind off feedback when the system is working (typically between sending a request to the TTS-server and receiving the response).

One of the most straight forward ways of doing this would be to introduce an animation for the play button.

The button animation can be done using FontAwesome (https://jsfiddle.net/Beppe/1tz4238k/), but may need some changing of how it's used, e.g. adding an element (like in the FA examples) rather than using :after.

Related Objects

Event Timeline

Making this the initial task in the tool project as a way of ensuring the patch-to-deploy routines all work.

Some relevant functions in ext.wikispeech.js: addButton(), prepareUtterance().

From chat, 2017-05-12:
@Eugene233

Ok
It is proposed that the addButton and PrepareUtterance functions are use for the task.
I have seen how addButton is useful to add a button to the control panel. Now do I have to implement a function to add the listitem which will hold the rotating item with class spinner?

@Sebastian_Berlin-WMSE

When I looked at how this could be solved, I found that a reasonable solution would be to change addButton() to instead of adding a class to the button, adding an element with the FA-classes to the button. Then, to add the spinner, you can use the stacking implemented in FA to add it on top of the play icon.

I implemented the fiddle in the js file. Now i think that the issue is the items in the span fails to stack on the button as the :after appears to influence it( just thinking)

The idea was remove the classes with :after, and instead add elements with fa-* classes. For the play button, these would be added to a span to enable stacking.

Change 353984 had a related patch set uploaded (by Eugene233; owner: Egbe Eugene):
[mediawiki/extensions/Wikispeech@master] Adding a buffer animation to the play button while the sound is loading

https://gerrit.wikimedia.org/r/353984

Change 353984 abandoned by Eugene233:
Adding a buffer animation to the play button while the sound is loading

Reason:
Created a different branch for this purpose.

https://gerrit.wikimedia.org/r/353984

Change 354010 had a related patch set uploaded (by Eugene233; owner: Egbe Eugene):
[mediawiki/extensions/Wikispeech@master] Adding a buffer animation to the play button while the sound is loading

https://gerrit.wikimedia.org/r/354010

Change 354181 had a related patch set uploaded (by Eugene233; owner: Egbe Eugene):
[mediawiki/extensions/Wikispeech@master] Adding a buffer animation to the play button while the sound is loading

https://gerrit.wikimedia.org/r/354181

Change 354181 abandoned by Eugene233:
Adding a buffer animation to the play button while the sound is loading

Reason:
Submitted a different patch for the same purpose

https://gerrit.wikimedia.org/r/354181

Change 365972 had a related patch set uploaded (by Eugene233; owner: Eugene23):
[mediawiki/extensions/Wikispeech@master] Adding a buffer animation to the play button while the sound is loading

https://gerrit.wikimedia.org/r/365972

Change 365972 abandoned by Lokal Profil:
Adding a buffer animation to the play button while the sound is loading

Reason:
abandoned in favour of https://gerrit.wikimedia.org/r/#/c/354010/5

https://gerrit.wikimedia.org/r/365972

Change 354010 merged by jenkins-bot:
[mediawiki/extensions/Wikispeech@master] Adding a buffer animation to the play button while the sound is loading

https://gerrit.wikimedia.org/r/354010

I'll mark it as solved once it's deployed to the demo server (later today or Monday).

Great work, @Eugene233. Nice to see it in action on the demo server.

I did notice that it didn't trigger properly every time and created a task for this: T175124.