Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Panel
borderColor#3D3D3D
bgColor#F4F4F4
titleColor#3D3D3D
borderWidth0
titleBGColor#3D3D3D
borderStylesolid

ON THIS PAGE

Table of Contents
indent20px

...

Enables GPU rasterization for HTML graphics. By default, the decision to use GPU rasterization is based on internal Chromium logic.

[boolean] canvas_2d_acceleration_enabled

...

[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.

...

Displays content from the specified URL. When using this method to retrieve content from local storage, specify the file location as follows: "file:/<drive>:/<directory>/<filename>". For example, an index.html file in the "Content" folder on the SD card can be selected with the string "file:/SD:/Content/index.html". You can also omit the drive specification to select the currently active drive (i.e. whichever drive the current autorun as loaded from).

...

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

EnableSecurity(enable As Dynamic) As Boolean 
Anchor
enablesecurity()
enablesecurity()

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:

...

Deprecated. Use security_params in initialization parameters instead.

EnableMouseEvents(enable As Boolean) As Boolean

Deprecated. Use mouse_enabled in initialization parameters instead.

SetPortrait(portrait_mode As Boolean) As Boolean

Deprecated. Use transform in initialization parameters 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 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.

...

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

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 deviceDeprecated. Use scrollbar_enabled in initialization parameters instead.

AddFont(filename As String) As Boolean

Deprecated. Use fonts in initialization parameters instead.

SetPcmAudioOutputs(outputs As roArray) As Boolean

Deprecated. Use pcm_audio_outputs in initialization parameters instead.

SetCompressedAudioOutputs(outputs As roArray) As Boolean

Deprecated. Use compressed_audio_outputs in initialization parameters instead.

SetMultichannelAudioOutputs(outputs As roArray) As Boolean

Deprecated. Use multi_channel_audio_outputs in initialization parameters instead. 

SetHWZDefault(default As String) As Void 
Anchor
sethwzdefault()
sethwzdefault()

Deprecated. Use hwz_default in initialization parameters instead.

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

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

EnableCanvas2dAcceleration(enable As Boolean) As Boolean

Deprecated. Use canvas_2d_acceleration_enabled in initialization parameters instead.

SetUserStylesheet(URI As String) As Boolean 
Anchor
setuserstylesheet()
setuserstylesheet()

Deprecated. Use user_stylesheet in initialization parameters instead.

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.

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.

...

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. See the SetLocalStorageQuota() entry above for details. 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.

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:

...

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

Deprecated. Use javascript_enabled in initialization parameters instead.

AllowJavaScriptURLs(url_collection As roAssociativeArray)

Deprecated.  If javascript_enabled is set to true in the initialization parameters, JavaScript objects are enabled for all sites.

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.


StartInspectorServer(port As Integer) As Boolean

...

Boolean

Deprecated. Use inspector_server in initialization parameters instead.

SetUserAgent(user_agent As String) As Boolean

Changes the default user-agent string for the roHtmlWidget instanceDeprecated. Use user_agent in initialization parameters instead.

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 specifiedDeprecated. Use user_agent in initialization parameters instead.

SetProxy(proxy as String) As Boolean

...

  • Proxy URL: The proxy address should be formatted as "http://user:password@hostname:port". The hostname can contain up to four "*" characters; each "*" character can be used to replace one octet from the current IP address. For example, if the IP address is currently 192.168.1.2, and the proxy is set to "proxy-*-*", then the player will attempt to use a proxy named "proxy-192.168".
  • Proxy File: The .pac proxy file can be located on either the local file system or the network. If the file is local, there are no file-name restrictions; if the file is located on the network, the file name should have a .pac extension. If the URL is a hostname only, it will be considered a proxy-server address rather than a file URL.
Tip
titleExample

 The following are examples of valid location formats for .pac files:

SetProxyBypass(hostnames As String) As Boolean

Exempts the specified hosts from the proxy configuration on the roHtmlWidget instance. The passed array should consist of one or more hostnames. The player will attempt to reach the specified hosts directly rather than using the proxy that has been specified with the SetProxy() method. For example, the hostname "example.com" would exempt "example.com", "example.com:80", and "www.example.com" from the proxy setting.

...

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)

...