2

How does the Touch-Bar control an HTML5 video? When a video or other media plays a slider comes up with a slider that can control the timing of the video. How does the touchbar interact with an html5 video to change the time? Is it using javascript or what?

Thanks in advance!

1
  • I think it may interact with the Quicktime plugin used to play videos. Commented Mar 20, 2018 at 2:34

1 Answer 1

3

The touch bar controller does not interact as such directly with HTML5 and it is not using Javascript.

It is instead the other way around. It is the browser that asks the touch bar controller to do something (i.e. for example to display buttons for previous and next page, open tab, etc.). This is done through the NSTouchBar class provided by Apple in AppKit.

The touch bar hardware in itself does not for example know that a button means to open a new tab in Firefox. Instead the application (for example Firefox) is told via NSTouchBar that the button has been pressed, and the application (Firefox in this example) must implement that functionality itself.

Therefore it is the browser that implements the action and thus controls the video – not the TouchBar.

3
  • Yes, but the TouchBar must respond in someway in order to interact with the video. Commented Jul 16, 2018 at 17:16
  • The touch bar hardware in itself does not for example know that a button means to open a new tab in Firefox. Instead the application (for example Firefox) is told via NSTouchBar that the button has been pressed, and the application (Firefox in this example) must implement that functionality itself.
    – jksoegaard
    Commented Jul 16, 2018 at 17:19
  • @Jbis Done! ....
    – jksoegaard
    Commented Jul 16, 2018 at 17:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .