Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: removed methods as per DOCS-674
Panel
borderColor#3D3D3D
bgColor#F4F4F4
titleColor#3D3D3D
borderWidth0
titleBGColor#3D3D3D
borderStylesolid

ON THIS PAGE

Table of Contents
indent20px

...

[string or double] storage_quota

Sets the total size (in bytes) allotted to all local storage applications (including IndexedDB). A BrightScript integer is only guaranteed to be able to represent a count of bytes up to 2GB so avoid using integers when calculating the size: Use float or double instead since they can represent values over 2GB (string can also be used but is not recommended). If the storage path is specified without a storage quota, Chromium defaults to reserving 1GB plus 10% of the total size of the storage device.

[roMessagePort] port

Configures the message port to which the roHtmlWidget instance will send events. When using initialization parameters, the port parameter should be used instead of the SetPort() method to ensure the script can catch load-startedload-finished, and load-error events.

...

Enables or disables pinch-to-zoom functionality, which is disabled by default.

...

SetTransform(

...

transform As

...

String) As

...

Enables or disables Chromium security checks for cross-origin requests, local video playback from HTTP, etc. (if the argument is Boolean). This method can also accept an associative array, which can contain the following parameters:

  • [Boolean] websecurity: Enables Chromium security checks. This parameter is identical to passing a Boolean argument to the method itself.
  • [Boolean] camera_enabled: Enables webpage access to USB cameras connected to the player (access is disabled by default). This allows support for WebRTC applications.
  • [Boolean] insecure_https_enabled: Instructs the widget to ignore security errors when connecting to insecure HTTPS hosts (insecure HTTPS is desabled by default). Enabling this feature makes the player insecure; it is not suitable for production environments and should only be used for testing.
Note
titleNote

The camera_enabled parameter is currently supported on the XTx44, XTx43, 4Kx42, XDx34, XDx33, HDx23, and LS423 models.

EnableMouseEvents(enable As Boolean) As Boolean

Enables response to mouse/touchscreen presses if true. Setting this method to false (the default) disables this feature.

SetPortrait(portrait_mode As Boolean) As Boolean

Sets the widget orientation to portrait if true. If this method is false (the default), the widget is oriented as a landscape.

Warning
titleImportant

 The SetPortrait() method has been deprecated in firmware 6.1. We recommend using the SetTransform() method instead.

SetTransform(transform As String) As Boolean

Sets the screen orientation of content in the widget (note that the coordinates and dimensions of the roRectangle containing the widget are not affected by rotation). This method accepts the following strings:

  • "identity": There is no transform (i.e. the widget content is oriented as landscape). This is the default setting.
  • "rot90": The widget content is rotated to portrait at 90 degrees (clockwise).
  • "rot270": The widget content is rotated to portrait at 270 degrees (counter-clockwise).
Note
titleNote

The JavaScript onload event will report landscape dimensions for a window that is rotated with the SetPortrait() or SetTransform() method. If your application relies on the onload event to retrieve window dimensions, we recommend instead using the transform initialization parameter, which ensures the HTML window is initialized with portrait dimensions.

SetAlpha(alpha As Integer) As Boolean

Sets the overall alpha level for the widget (the default equals 255).

EnableScrollbars(scrollbars As Boolean) As Boolean

Enables automatic scrollbars for content that does not fit into the viewport if true. Setting this method to false (the default) disables this feature.

AddFont(filename As String) As Boolean

Supplies additional or custom typefaces for the HTML rendering engine. Supported font types include TrueType Font files (.ttf) and Web Open Font files (.woff.woff2). 

SetPcmAudioOutputs(outputs As roArray) As Boolean

Configures the PCM audio output for the HTML widget. This method accepts one or more outputs in the form of an roArray of roAudioOutput instances.

SetCompressedAudioOutputs(outputs As roArray) As Boolean

Configures compressed audio output (e.g. Dolby AC3 encoded audio) for the HTML widget. This method accepts one or more outputs in the form of an roArray of roAudioOutput instances. 

Note
titleNote

When one or more audio-output methods are called, they will override the settings of the following ifAudioControl methods: SetAudioOutput(), MapStereoOutput(), SetUsbAudioPort(), MapDigitalOutput(). Calls to HTML audio-output methods will only take effect with subsequent calls to SetUrl(). Audio-output settings on an roHtmlWidget instance will be overwritten by equivalent settings in the HTML.

SetMultichannelAudioOutputs(outputs As roArray) As Boolean
 

...

Sets the default HWZ mode for HTML video. Normally, HWZ must be enabled in each <video> tag, but passing "on" to this string enables HWZ for all <video> elements. This method can also accept a semicolon-separated list of HWZ parameters:

  • on/off: Enables or disables HWZ mode.
  • z-index: Sets the default z-ordering for <video> elements. A positive integer places the video in front of all graphics; a negative integer places the video behind all graphics; and a zero value disables HWZ mode completely. You can customize the z-ordering of individual video elements with respect to each other by inserting the "z-index" parameter into the <video> tag.
  • transform: Sets the default rotation for <video> elements. HWZ mode must be enabled for transforms to work.
    • identity: No transformation (default behavior)
    • rot90: 90 degree clockwise rotation
    • rot180: 180 degree rotation
    • rot270: 270 degree clockwise rotation
    • mirror: Horizontal mirror transformation
    • mirror_rot90: Mirrored 90 degree clockwise rotation
    • mirror_rot180: Mirrored 180 degree clockwise rotation
    • mirror_rot270: Mirrored 270 degree clockwise rotation
  • fade: Sets the fading behavior for <video> elements.
    • auto: Videos transition without fade effects. This is the default behavior.
    • always : When a video ends, the video window will go black. The new video will then fade in.
  • luma-key/cr-key/cb-key: Enables luma and/or chroma keying for <video> elements. HWZ mode must be enabled for luma/chroma keying to work.
Code Block
titleExample
 html.SetHWZDefault("on; transform:rot90; luma-key:#ff0020;")
SetVideoPlayerDefaults(defaults As roAssociativeArray) As Boolean

Sets default playback settings for <video> elements in the widget. Available parameters are identical to the roVideoPlayer.PlayFile() method. Default settings will be overwritten by parameters specified in individual <video> elements.

ForceGpuRasterization(enable As Boolean) As Boolean

Enables GPU rasterization for HTML graphics. This method will take effect for subsequent page loads only. If Chromium determines that a page is not compatible, it will refuse to enable GPU rasterization for that page.

Note
titleNote

This method has been deprecated. As of OS8, GPU rasterization is enabled by default and calling this method has no effect.

EnableCanvas2dAcceleration(enable As Boolean) As Boolean

Enables 2D canvas acceleration. This will improve the framerate of most HTML pages that use 2D animations, but can cause out-of-memory issues with pages that use a large number of off-screen canvas surfaces.

Note
titleNote

This setting has been deprecated. As of OS8, Canvas acceleration is enabled by default and can be disabled by passing false to this method.

...

Applies the specified user stylesheet to the page(s) loaded in the widget. The parameter is a URI specifying any file: resource in the storage. The stylesheet can also be specified as inline data in the following form:

Code Block
"data:text/css;charset=utf-8;base64,<base64 encoded data>"

This method will fail if you specify the inline data in any other order or if you use any data format other than base64.

FlushCachedResources() As Boolean

Discards any resources that Chromium has cached in memory.

SetLocalStorageDir(file_path As String) As Boolean

Configures the HTML storage path. This method takes effect when a new roHtmlWidget instance is created; it doesn't apply to the roHtmlWidget instance on which it is called.

Note
titleNote

As of OS8, the SetLocalStorageDir()SetWebDatabaseDir(), and SetAppCacheDir() methods all configure the same HTML database. See the HTML Best Practices page for more details.

SetWebDatabaseDir(file_path As String) As Boolean

Configures the HTML storage path. See the SetLocalStorageDir() entry above for details.

This method takes effect when a new roHtmlWidget instance is created; it doesn't apply to the roHtmlWidget instance on which it is called.

...

Configures the HTML storage path. See the SetLocalStorageDir() entry above for details.

This method takes effect when a new roHtmlWidget instance is created; it doesn't apply to the roHtmlWidget instance on which it is called.

SetLocalStorageQuota(maximum As Dynamic) As Boolean

Sets the total size (in bytes) for all persistent HTML storage on the player. This method can accept a string, double, or integer. A number literal can only represent byte numbers up to 2GB; use a string to specify larger amounts. If the storage path is specified without a storage quota, Chromium defaults to reserving 1GB plus 10% of the total size of the storage device.

This method takes effect when a new roHtmlWidget instance is created; it doesn't apply to the roHtmlWidget instance on which it is called.

Note
titleNote

As of OS8, the SetLocalStorageQuota()SetWebStorageQuota(), and SetAppCacheQuota() methods all configure a single storage quota, which applies to all persistent HTML storage on the player. See the HTML Best Practices page for more details.

SetWebDatabaseQuota(maximum As Dynamic) As Boolean

Sets the total size (in bytes) for all persistent HTML storage on the player. See the SetLocalStorageQuota() entry above for details.

This method takes effect when a new roHtmlWidget instance is created; it doesn't apply to the roHtmlWidget instance on which it is called.

SetAppCacheSize(maximum As Integer) As Boolean

Sets the maximum size (in bytes) for the application cache. Changing the storage size of the application cache will clear the cache and rebuild the cache storage. Depending on database-specific attributes, you will only be able to set the size in units that are equal to the page size of the database, which is established at creation. These storage units will occur only in the following increments: 512, 1024, 2048, 4096, 8192, 16384, 32768.

EnableJavaScript(enable As Boolean) As Boolean

Enables/disables JavaScript on the widget. JavaScript is enabled by default.

AllowJavaScriptURLs(url_collection As roAssociativeArray)

Allows the specified JavaScript BrightScript classes to be used by the specified URLs (all BrightScript classes in JavaScript are disabled by default). This method accepts an associative array that maps JavaScript BrightScript classes to the URL(s) that are allowed to use them.

  • An all key indicates that all classes are authorized for the associated URL(s).
  • An asterisk "*" value indicates that all URLs are authorized for the associated BrightScript class.
  • A "local" value indicates that all local pages are authorized for the associated BrightScript class.

The following will enable all BrightScript classes for all URLs:

Code Block
html.AllowJavaScriptUrls({ all: "*" })

The following will enable all BrightScript classes for local pages and the BrightSign homepage:

...

Boolean

Sets the screen orientation of content in the widget (note that the coordinates and dimensions of the roRectangle containing the widget are not affected by rotation). This method accepts the following strings:

  • "identity": There is no transform (i.e. the widget content is oriented as landscape). This is the default setting.
  • "rot90": The widget content is rotated to portrait at 90 degrees (clockwise).
  • "rot270": The widget content is rotated to portrait at 270 degrees (counter-clockwise).
Note
titleNote

The JavaScript onload event will report landscape dimensions for a window that is rotated with the SetPortrait() or SetTransform() method. If your application relies on the onload event to retrieve window dimensions, we recommend instead using the transform initialization parameter, which ensures the HTML window is initialized with portrait dimensions.

SetAlpha(alpha As Integer) As Boolean

Sets the overall alpha level for the widget (the default equals 255).

SetVideoPlayerDefaults(defaults As roAssociativeArray) As Boolean

Sets default playback settings for <video> elements in the widget. Available parameters are identical to the roVideoPlayer.PlayFile() method. Default settings will be overwritten by parameters specified in individual <video> elements.

FlushCachedResources() As Boolean

Discards any resources that Chromium has cached in memory.

SetLocalStorageDir(file_path As String) As Boolean

Configures the HTML storage path. This method takes effect when a new roHtmlWidget instance is created; it doesn't apply to the roHtmlWidget instance on which it is called.

Note
titleNote

As of OS8, the SetLocalStorageDir()SetWebDatabaseDir(), and SetAppCacheDir() methods all configure the same HTML database. See the HTML Best Practices page for more details.

SetWebDatabaseDir(file_path As String) As Boolean

Configures the HTML storage path. See the SetLocalStorageDir() entry above for details.

This method takes effect when a new roHtmlWidget instance is created; it doesn't apply to the roHtmlWidget instance on which it is called.

SetAppCacheDir(file_path As String) As Boolean 
Anchor
setappcachedir()
setappcachedir()

Configures the HTML storage path. See the SetLocalStorageDir() entry above for details.

This method takes effect when a new roHtmlWidget instance is created; it doesn't apply to the roHtmlWidget instance on which it is called.

SetLocalStorageQuota(maximum As Dynamic) As Boolean

Sets the total size (in bytes) for all persistent HTML storage on the player. This method can accept a string, double, or integer. A number literal can only represent byte numbers up to 2GB; use a string to specify larger amounts. If the storage path is specified without a storage quota, Chromium defaults to reserving 1GB plus 10% of the total size of the storage device.

This method takes effect when a new roHtmlWidget instance is created; it doesn't apply to the roHtmlWidget instance on which it is called.

Note
titleNote

As of OS8, the SetLocalStorageQuota()SetWebStorageQuota(), and SetAppCacheQuota() methods all configure a single storage quota, which applies to all persistent HTML storage on the player. See the HTML Best Practices page for more details.

SetWebDatabaseQuota(maximum As Dynamic) As Boolean

Sets the total size (in bytes) for all persistent HTML storage on the player. See the SetLocalStorageQuota() entry above for details.

This method takes effect when a new roHtmlWidget instance is created; it doesn't apply to the roHtmlWidget instance on which it is called.

SetAppCacheSize(maximum As Integer) As Boolean

Sets the maximum size (in bytes) for the application cache. Changing the storage size of the application cache will clear the cache and rebuild the cache storage. Depending on database-specific attributes, you will only be able to set the size in units that are equal to the page size of the database, which is established at creation. These storage units will occur only in the following increments: 512, 1024, 2048, 4096, 8192, 16384, 32768.

PostJSMessage(data As roAssociativeArray) As Boolean

...

Note
titleNote

 Changing the DOM is only possible at bind_dom_loaded and bind_ready. Also, since JavaScript is only guaranteed to be ready at bind_ready, your callbacks must use this event if they invoke any global functions.

...

Enables the Chromium Inspector, which allows you to debug JavaScript applications while a webpage is running. To access the console, navigate to the player IP address at the specified port number. See this page for documentation relating to the JavaScript console.

SetUserAgent(user_agent As String) As Boolean

...

ready at bind_ready, your callbacks must use this event if they invoke any global functions.

GetUserAgent() As String

Returns the currently active user-agent string for the roHtmlWidget instance.

SetUserAgentSuffix(suffix As String) As Boolean

Appends text to the current user-agent string. Subsequent calls to this method will replace the suffix that was previously specified.

SetProxy(proxy as String) As Boolean

...

Allows the user to set up one or more proxies. If proxy pac files are included, this method must be used to specify authentication parameters.

ifMessagePort

SetPort(port As roMessagePort)

...