8 Client "API" - lebaston100/htmlOverlayFramework GitHub Wiki

The client api enables you to easily receive the messages sent by the controller. They are available on the client side through client.js

sendCommand(command, content);

Sends a command to all connected controller and clients(e.g. feedback from the client to the controller)

  • command: Something to seperate your request. (Text or json object/array)
  • content: The content to send. (Text or json object/array)

Example see Controller API Wiki page


changeElementContent(id, newContent);

Changes the content of the object(e.g. changing a text in a div or span)

  • id: The id of the element to change
  • newContent: The new content to change to (html tags supported)

Example


showContent(id);

Shows the selected object if previously hidden with ´hideContent`

  • id: The id of the object to show

Example


hideContent(id);

Hides the selected object

  • id: The id of the object to hide

Example


playMedia(id);

Starts playback of <audio> and <video> tags

  • id: The id of the <audio> or <video> object

Example


pauseMedia(id);

Pauses playback of <audio> and <video> tags

  • id: The id of the <audio> or <video> object

setMediaVolume(id, volume);

Sets the playback volume of <audio> and <video> tags

  • id: The id of the <audio> or <video> object
  • volume: The volume to set to. Range from 0-100

Example

⚠️ **GitHub.com Fallback** ⚠️