Closed
Bug 1155661
Opened 10 years ago
Closed 9 years ago
Add playback control buttons to the top toolbar in the animation inspector
Categories
(DevTools :: Inspector: Animations, defect)
DevTools
Inspector: Animations
Tracking
(firefox43 fixed, firefox44 verified)
VERIFIED
FIXED
Firefox 43
People
(Reporter: pbro, Assigned: pbro)
References
Details
Attachments
(7 files)
1.46 MB,
image/gif
|
Details | |
4.81 KB,
patch
|
zer0
:
review+
|
Details | Diff | Splinter Review |
8.41 KB,
patch
|
zer0
:
review+
|
Details | Diff | Splinter Review |
9.95 KB,
patch
|
miker
:
review+
|
Details | Diff | Splinter Review |
4.04 KB,
patch
|
bgrins
:
review+
|
Details | Diff | Splinter Review |
11.50 KB,
patch
|
miker
:
review+
|
Details | Diff | Splinter Review |
16.36 KB,
patch
|
miker
:
review+
|
Details | Diff | Splinter Review |
The animation inspector will show more animations with bug 1153271, and specifically, animations that are often sequenced together.
In this context, it makes sense for the top toolbar (now only used for the global play/pause button) to become the toolbar that can control all currently displayed animation widgets.
I can see 2 cases:
- there are currently no animations displayed inside the sidebar:
in this case, the top toolbar should contain the global play/pause button, like today + a global playback rate select to set the playback rate for *all* animations on the page.
- there are animations displayed in the sidebar:
in that case, the controls in the top toolbar become contextual to the animations currently displayed and allow: play/pause, playback rate selection, rewind, fast-forward.
See the mockup in bug 1153271 comment 1.
Assignee | ||
Updated•10 years ago
|
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → pbrosset
Status: NEW → ASSIGNED
Assignee | ||
Comment 1•9 years ago
|
||
Status update: I'm currently working on a patch series to introduce a play/pause button above the timeline. This button will pause all animations currently displayed in the timeline. Clicking again will resume. Once the scrubber has reached the end of the timeline (i.e. all animations are finished), clicking again will start again from the beginning.
Attaching an animated GIF of my current work in progress.
I should start attaching patches for review soon.
Assignee | ||
Comment 2•9 years ago
|
||
Part 1 - Just a simple rename of the existing animation-inspector toolbar
Why? Because the mechanism I've chosen to implement the new toolbar is:
- the global toolbar that exists today is there for global buttons, things that impact *all* animations in the page (and in nested iframes too), whether or not they are displayed in the timeline at this stage,
- whereas timeline-related toolbar buttons are going to impact only those animations currently displayed in the timeline, and the set of buttons may be different from the global ones.
Therefore, the next patch will introduce a second toolbar element (hence the need to change the current one's name), and it will substitute the global toolbar element whenever there are animations displayed in the timeline.
Attachment #8661789 -
Flags: review?(zer0)
Assignee | ||
Comment 3•9 years ago
|
||
Part 2 - Actually adds the new timeline toolbar, and implements the mechanism that shows/hides the right toolbar depending on the presence of animations in the UI.
Attachment #8661796 -
Flags: review?(zer0)
Assignee | ||
Comment 4•9 years ago
|
||
Part 3 - This adds a new method to the AnimationsActor that allows to play/pause a number of AnimationPlayers at once. This isn't used in this patch yet, will be useful for later parts. I've added a test for this.
The reason for adding this is that if you just pause/play all animations from the front-end, by sending requests one by one, that's going to offset the animations by some amount of time (due to the time it takes the request to reach the server).
Attachment #8661797 -
Flags: review?(mratcliffe)
Assignee | ||
Comment 5•9 years ago
|
||
Part 4 - This part only adds the new play/pause button in the timeline toolbar, but doesn't add any behavior to it. Later parts will take care of this.
This part however changes some of panel's CSS to be able to reuse styles from the pause button that was already defined.
Attachment #8661799 -
Flags: review?(bgrinstead)
Assignee | ||
Comment 6•9 years ago
|
||
Part 5 - This part implements one side of the play/pause button logic, that is, when the user clicks in the timeline and moves the scrubber around, the button should react to this and change its state accordingly.
When the scrubber is moving (i.e. animations are playing), it should show a pause icon.
After the scrubber has been moved around (i.e. animations are now paused), it should show a play icon.
The other side of the logic is when the button is clicked, we want the animations to play/pause. The next patch will take care of this.
Attachment #8661816 -
Flags: review?(mratcliffe)
Assignee | ||
Comment 7•9 years ago
|
||
I will upload the final part (part 6) tomorrow after I've finalized a new test I'm adding.
In the meantime, here's a try push for parts 1 to 3: https://treeherder.mozilla.org/#/jobs?repo=try&revision=79d82d1637bc
Attachment #8661797 -
Flags: review?(mratcliffe) → review+
Attachment #8661816 -
Flags: review?(mratcliffe) → review+
Comment 8•9 years ago
|
||
Comment on attachment 8661799 [details] [diff] [review]
Bug_1155661_-_4_-_Add_the_timeline_play_pause_butt.diff
Review of attachment 8661799 [details] [diff] [review]:
-----------------------------------------------------------------
Looks reasonable
::: browser/themes/shared/devtools/animationinspector.css
@@ +96,2 @@
>
> +#global-toolbar button,
Maybe this should be .devtools-button instead of button to match the selectors below
Attachment #8661799 -
Flags: review?(bgrinstead) → review+
Assignee | ||
Comment 9•9 years ago
|
||
Part 6 - This is the last part. It implements the 2nd part of the play/pause logic, which is the mechanism that actually plays/pauses animations when the toolbar button is pressed.
Note that when I first coded the panel, I chose to implement parts of the UI as components. Components have a render method and are rendered everytime a piece of the state that they are interested in changes.
So to not break this convention, what happens when the button is clicked is that the animations are played/paused on the server, then the corresponding fronts are just refreshed and the timeline component is re-rendered. This helps keep the UI update mechanism simple.
Another interesting thing to note is: when animations are paused (using the web animations API), their startTime becomes null (this is something defined by the API's spec). Because of this, if you click on the button, then refresh the animations' states, and then re-render the timeline, you can't position the animations anymore in the UI.
What I ended up doing here is add a 'previousStartTime' field to the animations' states which is always equal to 'startTime' as long as it isn't null. If it is null, then 'previousStartTime' is just the last known value.
Attachment #8661993 -
Flags: review?(mratcliffe)
Assignee | ||
Comment 10•9 years ago
|
||
Try push for parts 1 to 6: https://treeherder.mozilla.org/#/jobs?repo=try&revision=3ef43a5f06e0
Updated•9 years ago
|
Attachment #8661789 -
Flags: review?(zer0) → review+
Attachment #8661993 -
Flags: review?(mratcliffe) → review+
Comment 11•9 years ago
|
||
Comment on attachment 8661796 [details] [diff] [review]
Bug_1155661_-_2_-_Add_a_new_timeline_toolbar_shown.diff
Review of attachment 8661796 [details] [diff] [review]:
-----------------------------------------------------------------
Looks good to me! Tested also locally.
Attachment #8661796 -
Flags: review?(zer0) → review+
Assignee | ||
Comment 12•9 years ago
|
||
Rebased, addressed review comments, and landed on fx-team:
remote: https://hg.mozilla.org/integration/fx-team/rev/204ecb6628ce
remote: https://hg.mozilla.org/integration/fx-team/rev/6c3532823c25
remote: https://hg.mozilla.org/integration/fx-team/rev/b8d10d58218e
remote: https://hg.mozilla.org/integration/fx-team/rev/0c461fc0a823
remote: https://hg.mozilla.org/integration/fx-team/rev/fb954e0271ec
remote: https://hg.mozilla.org/integration/fx-team/rev/bb283bb54d56
https://hg.mozilla.org/mozilla-central/rev/204ecb6628ce
https://hg.mozilla.org/mozilla-central/rev/6c3532823c25
https://hg.mozilla.org/mozilla-central/rev/b8d10d58218e
https://hg.mozilla.org/mozilla-central/rev/0c461fc0a823
https://hg.mozilla.org/mozilla-central/rev/fb954e0271ec
https://hg.mozilla.org/mozilla-central/rev/bb283bb54d56
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
status-firefox43:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 43
Comment 14•9 years ago
|
||
Why add another button, when only one of the global or timeline buttons is shown at the same time?
Comment 15•9 years ago
|
||
I managed to test the functionality of the Play/Pause button from the top toolbar on Nightly 44.0a1 (2015-10-20) across platforms [1].
I can confirm that:
- a Play/Pause button is displayed if there are no animations available inside the sidebar and another Play/Pause button if there are animations available in the sidebar.
- the button shows the correct icon, according to the animation's state (paused, playing)
- the scrubber can be manually moved. While this action is performed, the button shows the Play icon.
- if clicking the pause button, the animation, the scrubber and the time are paused.
[1]Windows 10 x86, Ubuntu 13.10 x64 and Mac OS X 10.10.4
Status: RESOLVED → VERIFIED
status-firefox44:
--- → verified
Assignee | ||
Updated•9 years ago
|
Component: Developer Tools: Inspector → Developer Tools: Animation Inspector
Updated•6 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•