...
...
...
...
...
...
...
...
borderColor | #3D3D3D |
---|---|
bgColor | #F4F4F4 |
titleColor | #3D3D3D |
borderWidth | 0 |
titleBGColor | #3D3D3D |
borderStyle | solid |
...
ON THIS PAGE
Table of Contents | ||
---|---|---|
|
...
...
...
...
title | Note |
---|
...
...
...
...
...
...
...
...
...
...
...
Note | ||
---|---|---|
| ||
This setting has been deprecated. As of OS8, Canvas acceleration is enabled by default and can be disabled by setting this flag to |
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.
[boolean] javascript_enabled
Enables JavaScript on the widget. This value is true
by default.
[boolean] brightsign_js_objects_enabled
Enables BrightScript-JavaScript objects. This value is false
by default.
In OS 8.2.55.4 and later, html widgets that are loaded from HTTP/HTTPS protocols do not share the same local storage database (html widgets that are loaded via file protocol act as they did in previous releases). These flags allow you to change the default behavior of widgets loaded through HTTP/HTTPS from "unshared" to "shared", or to change the default behavior of widgets with locally loaded files to "unshared" from "shared":
[boolean] force_shared_storage
Allows html widgets loaded via HTTP/HTTPS protocol to share local storage if they are loaded from the same domain.
[boolean] force_unshared_storage
Prevents html widgets loaded via FILE protocol from sharing storage.
...
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). The following values are accepted:
"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).
[string] user_agent
Modifies the default user-agent string for the roHtmlWidget instance.
[string] url
The URL to use for display. See the SetUrl()
entry below for more information on using URIs to access files from local storage.
[string] language
Specifies the language to load the web page in.
[string] user_stylesheet
Applies the specified user stylesheet to pages in the widget. The parameter is a URI specifying any file:
resource in the storage. The stylesheet can also be specified as inline data.
[string] hwz_default
Specifies the default HWZ behavior. See the SetHWZDefault()
entry below for more information.
[string] storage_path
...
[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-started
, load-finished
, and load-error
events.
[roArray] fonts
Specifies a list of font files that can be accessed by the webpage. Font files are specified as an array of string filenames. Supported font types include TrueType Font files (.ttf) and Web Open Font files (.woff, .woff2).
[roArray] pcm_audio_outputs
Configures the PCM audio output for the HTML widget. Outputs are specified as an array of strings, each string being the name of an output. (See roAudioOutput documentation for a list of acceptable names.)
[roArray] compressed_audio_outputs
Configures compressed audio output (e.g. Dolby AC3 encoded audio) for the HTML widget. Outputs are specified as an array of roAudioOutput instances.
[roArray] multi_channel_audio_outputs
Configures multi-channel audio output for the HTML widget. Outputs are specified as an array of roAudioOutput instances.
[roAssociativeArray] inspector_server
...
[string] ip_addr
: The Inspector IP address. This value is useful if the player is assigned more than one IP address (i.e. there are multiple network interfaces) and you wish to limit the Inspector server to one. The default value is"0.0.0.0"
, which allows the Inspector to accept connections using either IP address.[int] port
: The port for the Inspector server.
[roAssociativeArray] security_params
Enables or disables Chromium security checks for cross-origin requests, local video playback from HTTP, etc.
[Boolean] websecurity
: Enables Chromium security checks.[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 disabled by default). Enabling this feature makes the player insecure; it is not suitable for production environments and should only be used for testing.
...
title | Note |
---|
...
...
...
...
...
...
"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 | ||
---|---|---|
| ||
The JavaScript |
SetAlpha(alpha As Integer) As Boolean
Sets the overall alpha level for the widget (the default equals 255).
EnableScrollbars(scrollbars As Boolean) As Boolean
Deprecated. 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.
...
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.
...
Deprecated. Use user_stylesheet
in initialization parameters instead.
FlushCachedResources() As Boolean
...
...
title | Note |
---|
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.
...
...
title | Note |
---|
...
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. Usejavascript_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
Posts a collection of key:value pairs to the BSMessagePort JavaScript class (see the JavaScript Objects for BrightScript tech note for more details). This method does not support passing nested associative arrays.
InjectJavaScript(code As String) As Boolean
Immediately injects a user script into the JavaScript engine. The passed string can contain any of the following: pure JavaScript code, a path to a JavaScript file, or a base64-encoded string (i.e. beginning with data:text/javascript;charset=utf-8;base64,
).
This method can be used to simulate the bind_ready
option:
Code Block |
---|
if type(event) = "roHtmlWidgetEvent" then
if event.GetData().reason = "load-finished" then
h.InjectJavascript("fillPasswordFields()")
end if
end if |
...
title | Note |
---|
...
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
Deprecated. Use inspector_server in initialization parameters instead.
SetUserAgent(user_agent As String) As Boolean
Deprecated. 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
Deprecated. Use
...
user_agent in initialization parameters instead.
SetProxy(proxy as String) As Boolean
Sets the name or address of the proxy server that the roHtmlWidget instance will use to make HTTP requests. This method takes effect immediately. It does not affect network operations performed by other components in the firmware. The string can be used to specify either the proxy URL or the location of a .pac proxy file:
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 |
---|
...
Example 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.
AddProxyAuthenticationCredentials(hostname As String, username As String, password As String)
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.
roHtmlWidget.acceptdialog(response as String)
Accept any dialog request with the given string, if there is any such request. This parameter was added in BOS 8.5.16.
roHtmlWidget.rejectdialog()
Reject any dialog request. This parameter was added in BOS 8.5.16.
ifMessagePort
SetPort(port As roMessagePort)
Posts messages of type roHtmlWidgetEvent to the attached message port.
ifUserData
SetUserData(user_data As Object)
Sets the user data that will be returned when events are raised.
GetUserData() As Object
Returns the user data that has previously been set via SetUserData()
. It will return Invalid if no data has been set.
Available Methods with Initialization
Anchor | ||||
---|---|---|---|---|
|
If the properties of an roHtmlWidget object are configured at initialization, most ifHtmlWidget methods will be disabled. However, the following methods are still functional:
Hide()
Show()
EnablePinchToZoom()
FlushCachedResources()
SetUserAgent()
GetUserAgent()
SetUserAgentSuffix()
PostJSMessages()
Examples
The following examples show how to use either an associative array or object methods to configure an roHtmlWidget instance using local storage to cache the files.
Note that these techniques are mutually exclusive.
...
Example (with initialization properties)
Code Block |
---|
x = 0
y = 0
width = 1920
height = 1080
url = "http://www.brightsign.biz"
rect = CreateObject("roRectangle", x, y, width, height)
config = {
url: url,
mouse_enabled: true,
storage_path: "/local/",
}
html = CreateObject("roHtmlWidget", rect, config)
html.Show() |
...
Example (with methods)
Code Block |
---|
x = 0
y = 0
width = 1920
height = 1080
url = "http://www.brightsign.biz"
rect = CreateObject("roRectangle", x, y, width, height)
html = CreateObject("roHtmlWidget", rect)
html.SetUrl(url)
html.EnableMouseEvents(true)
html.SetLocalStorageDir("/local/")
html.Show() |