### Stream Start Time Offset Example Source: https://developer.roku.com/dev/docs/content-metadata Example of an integer value for the offset into the stream considered the beginning of playback, in seconds. ```text 3600 ``` -------------------------------- ### Starting Scene Graph Applications Source: https://developer.roku.com/dev/docs/ifsgscreen This example demonstrates how to initialize and display a SceneGraph application using roSGScreen. It sets up the message port, retrieves the global node, adds fields to it, creates a scene, and shows it on the screen. It also includes basic event handling for screen closure. ```brightscript sub showChannelSGScreen() print "in showChannelSGScreen" screen = CreateObject("roSGScreen") m.port = CreateObject("roMessagePort") screen.setMessagePort(m.port) m.global = screen.getGlobalNode() m.global.id = "GlobalNode" m.global.addFields( {red: &hff0000ff, green: &h00ff00ff, blue: &h0000ffff} ) scene = screen.CreateScene("TrivialScene") screen.show() scene.setFocus(true) child = createObject("RoSGNode","ContentNode") child.contentkey = "test_string" print "child: '"; child.contentkey; "'" while(true) msg = wait(0, m.port) msgType = type(msg) if msgType = "roSGScreenEvent" if msg.isScreenClosed() then return end if end while end sub ``` -------------------------------- ### Play Start Example Source: https://developer.roku.com/dev/docs/content-metadata Example of a float value defining the start position of content in seconds. Supports negative values from Roku OS 8.0. ```text 0 ``` -------------------------------- ### Example Ad Event Callback Function Source: https://developer.roku.com/dev/docs/ssai-adapters This is an example of a callback function that can be registered with the adapter to handle ad events. It demonstrates how to react to different ad states like ad starting or ending. ```brightscript function rafxCallback(eventInfo as object) as void if adapter.AdEvent.POD_START = eventInfo.event m.top.adPlaying = true else if adapter.AdEvent.POD_COMPLETE = eventInfo.event m.top.adPlaying = false end if print "Callback at : ";eventInfo.position end function ``` -------------------------------- ### Install Robot Framework Library Dependencies Source: https://developer.roku.com/dev/docs/automated-channel-testing Install all necessary dependencies for the Robot Framework Library from the requirements.txt file. ```bash python -m pip install -r /automated-channel-testing-master/RobotLibrary/requirements.txt ``` -------------------------------- ### Install Mocha and Mochawesome Globally Source: https://developer.roku.com/dev/docs/automated-channel-testing Installs the Mocha test framework and Mochawesome reporter globally using Yarn. ```bash yarn global add mocha yarn global add mochawesome ``` -------------------------------- ### Example Manifest File Source: https://developer.roku.com/dev/docs/developing-scenegraph-applications Provides a concrete example of a manifest file with sample values for application details, icons, and splash screen settings. ```text title=Test Application subtitle=A SceneGraph Test major_version=1 minor_version=1 build_version=00001 mm_icon_focus_hd=pkg:/images/MainMenu_Icon_Center_HD.png mm_icon_side_hd=pkg:/images/MainMenu_Icon_Side_HD.png mm_icon_focus_sd=pkg:/images/MainMenu_Icon_Center_SD43.png mm_icon_side_sd=pkg:/images/MainMenu_Icon_Side_SD43.png splash_screen_sd=pkg:/images/splash_sd.jpg splash_screen_hd=pkg:/images/splash_hd.jpg splash_color=#000000 splash_min_time=1000 ``` -------------------------------- ### Setup Source: https://developer.roku.com/dev/docs/ifevpcipher Configures and initializes a new cipher context for encryption or decryption. ```APIDOC ## Setup(encrypt as Boolean, format as String, key as String, iv as String, padding as Integer) as Integer ### Description Configures and initializes a new cipher context. ### Parameters #### Parameters - **encrypt** (Boolean) - Required - True for encryption; false for decryption - **format** (String) - Required - Cipher format string, from openssl, listed at roEVPCipher - **key** (String) - Required - A hex-encoded key - **iv** (String) - Required - A hex-encoded initialization vector, which can be an empty string - **padding** (Integer) - Required - 1 to use standard padding; 0 for no padding ### Return Value Returns 0 on success or non-zero on failure. ``` -------------------------------- ### Get List of Installed Apps Source: https://developer.roku.com/dev/docs/javascript-library Returns a list of installed apps. Each app object contains title, id, type, version, and subtype. ```javascript expect(apps[0].ID).to.equal('some_id') const apps = await library.getApps() ``` -------------------------------- ### Example Robot Framework Configuration for Multiple Devices Source: https://developer.roku.com/dev/docs/automated-channel-testing An example JSON configuration file demonstrating how to set up testing for multiple Roku devices with specific IP addresses, timeouts, and press delays. ```json { "devices": { "Amarillo": { "ip_address": "192.168.1.64", "timeout": 20000, "pressDelay": 2000 }, "Littlefield": { "ip_address": "192.168.1.16", "timeout": 25000, "pressDelay": 1000 } }, "server_path": "/automated-channel-testing-master/bin/RokuWebDriver_", "test": "Tests/Basic_tests_multi_device.robot", "outputdir": "Results" } ``` -------------------------------- ### GET v1/session/:sessionId/apps Source: https://developer.roku.com/dev/docs/web-driver Returns a list of apps installed on the device. ```APIDOC ## GET v1/session/:sessionId/apps ### Description Returns a list of apps installed on the device. ### Method GET ### Endpoint v1/session/:sessionId/apps ### Parameters #### Path Parameters - **sessionId** (string) - Required - The ID of the session for which to retrieve the app list. ``` -------------------------------- ### Get Installed Apps Source: https://developer.roku.com/dev/docs/robot-framework-library Retrieves a list of all installed applications on the Roku device. Each app object includes details like title, id, type, version, and subtype. ```robotframework @{apps}=Get Apps ``` -------------------------------- ### POST v1/session/:sessionId/install Source: https://developer.roku.com/dev/docs/web-driver Installs the specified app. ```APIDOC ## POST v1/session/:sessionId/install ### Description Installs the specified app. ### Method POST ### Endpoint v1/session/:sessionId/install ### Parameters #### Path Parameters - **sessionId** (string) - Required - The ID of the session where the command is to be sent. ``` -------------------------------- ### MacOS Example with Options Source: https://developer.roku.com/dev/docs/rrm-data-collection-mode This example demonstrates running RRM in headless mode on MacOS with specific device, output, panel, and polling interval configurations. ```bash roku-resource-monitor --headless --device-ip=192.168.0.0 --channel-id=1 --output-file=/home/Downloads --panels=cpu,memory --polling-interval=1 ``` -------------------------------- ### Get Elapsed Timer Source: https://developer.roku.com/dev/docs/robot-framework-library Retrieves the number of milliseconds that have passed since the timer was last started using 'Mark timer'. ```robotframework ${time} = Get timer ``` -------------------------------- ### Setup Source: https://developer.roku.com/dev/docs/ifhmac Initializes a new HMAC context with a specified digest algorithm and key. ```APIDOC ## Setup(digestType as String, key as Object) as Integer ### Description Initializes new HMAC context. ### Parameters #### Path Parameters - **digestType** (String) - Required - Selects one of the supported digest algorithms, as documented in [roEVPDigest](https://developer.roku.com/dev/docs/roevpdigest). - **key** (Object) - Required - An roByteArray containing the key for the MAC. ### Return Value An integer indicating whether the function succeeded (0) or failed (1). ``` -------------------------------- ### Custom Screen Function Example Source: https://developer.roku.com/dev/docs/brightscript-doc Demonstrates documenting a function that creates and runs a custom screen. It includes examples of parameter and return value documentation, as well as internal comments. ```brightscript ' ' Embodies the creation and running of a single custom screen for XYZ‐hosted content ' ' @param utils an instance of the AA utils object created from calling the {@link .CreateUtils Utils Constructor} ' @param site the site string ' @param titlePrefix a static prefix for the video title display line ' @param contentAAArray an Array of content meta‐data Aas ' @return false if there was an error during creating or running this screen. ' @see the Content metadata doc ' @see .CreateUtils CreateUtils() function ShowCustomScreen(utils as Object, site as String, titlePrefix as String, contentAAArray as Object) as BooLean ' This is the z variable. It does nothing useful... ' except as the target of a @see or @{link} ' BrightScriptDoc tag z = "something" ' This is an example of top comments winning out over same‐line. ' BrightScriptDoc prefers above comments over same‐line comments. ' This is the set of lines that'll be used in hover‐docs and auto‐completion. x = 1 ' This comment won't be used by BrightScriptDoc y = { ' Anonymous functions comments are best placed above the field assignment ' So that all the relevant tags can be used ' ' @param bar an integer that's apparently useful in calculating foo ' @param baz who knows what kind of object this is ' @return A string of some sort getFoo : function(bar as Integer, baz as Object) as String end function } z = CreateObject("roFoo") end function ``` -------------------------------- ### Get Timer Source: https://developer.roku.com/dev/docs/robot-framework-library Returns the elapsed time in milliseconds since the timer was last started. This keyword is available from release 2.0 onwards. ```APIDOC ## Get Timer ### Description Returns the number of milliseconds elapsed since the timer was last started. ### Keyword `Get timer` ### Availability Available since release 2.0. ### Example ```robotframework ${time} = Get timer ``` ``` -------------------------------- ### Example Server XML File Source: https://developer.roku.com/dev/docs/downloading-server-content This XML file provides a list of items with text attributes, which can be parsed by a BrightScript Task node to populate a ContentNode. ```xml ``` -------------------------------- ### Get DRM Information Example Source: https://developer.roku.com/dev/docs/ifdeviceinfo Retrieves supported DRM systems and their features. Note that GetDrmInfo() is deprecated and GetDrmInfoEx() should be used instead. ```brightscript PlayReady : { multikey: false securestop: true tee: false version: "2.5" securityLevel: "3000" } Widevine : { multikey: true securestop: false tee: false version: "widevine 16.4.0" securityLevel: "1" } ``` -------------------------------- ### Example config.json for Multi-Device Testing Source: https://developer.roku.com/dev/docs/automated-channel-testing An example of a config.json file demonstrating how to configure multiple Roku devices, server path, test case, and output directory. ```json { "devices": { "Amarillo": { "ip_address": "192.168.1.64", "timeout": 20000, "pressDelay": 2000 }, "Littlefield": { "ip_address": "192.168.1.16", "timeout": 25000, "pressDelay": 1000 } }, "server_path": "/automated-channel-testing-master/bin/RokuWebDriver_", "test": "multipleDevices/multiple_devices_test_basics.js", "outputdir": "Results" } ``` -------------------------------- ### Get Focused Element Example Source: https://developer.roku.com/dev/docs/robot-framework-library Retrieves the element that currently has focus on the screen. This is useful for interacting with UI elements that are actively selected. ```Robot Framework &{element}= Get focused element ``` -------------------------------- ### Get Elapsed Timer Value Source: https://developer.roku.com/dev/docs/javascript-library Returns the number of milliseconds elapsed since the timer was last started. Available since release 2.0. ```javascript let res = await library.verifyIsPlaybackStarted(25, 1); expect(res).to.equal(true); let time = library.getTimer(); expect(14000).greaterThan(time); ``` -------------------------------- ### Get and Set User Authentication Data in Registry Source: https://developer.roku.com/dev/docs/roregistrysection Demonstrates how to create a registry section, check for the existence of a key, read its value, and write a new value to the registry. Use Flush() to ensure data is written. ```brightscript function GetAuthData() as Dynamic sec = CreateObject("roRegistrySection", "Authentication") if sec.Exists("UserRegistrationToken") return sec.Read("UserRegistrationToken") end if return invalid end function function SetAuthData(userToken as String) as Void sec = CreateObject("roRegistrySection", "Authentication") sec.Write("UserRegistrationToken", userToken) sec.Flush() end function ``` -------------------------------- ### Get Element Source: https://developer.roku.com/dev/docs/robot-framework-library Searches for an element on the page starting from the screen root, based on specified locator data. Returns information on the first matching element. ```APIDOC ## Get Element ### Description Searches for an element on the page based on the specified locator starting from the screen root. Returns information on the first matching element. ### Keyword `Get element` ### Arguments * **data**: An object with locators for elementData and parentData (parentData is optional). See the [WebDriver element command](/docs/developer/dev-tools/automated-channel-testing/web-driver.md#POST-v1/session/:sessionId/elements) for more information. * **delay**: The delay (in seconds) between retries. Optional, defaults to 1 second. ### Example ```robotframework Get element {"elementData": {"title": "some title"}} 1 ``` ``` -------------------------------- ### Example Product Data Source: https://developer.roku.com/dev/docs/instant-signup Provides an example of the JSON structure for returning product data, including product IDs and descriptions. This is used when a customer is eligible for offers. ```json { "products": [ { "id": "roku_developers_monthly", "desc": "Unlimited streaming access to all Roku Developers content" }, { "id": "roku_developers_annual", "desc": "Unlimited streaming access to all Roku Developers content." } ] } ``` -------------------------------- ### Get Apps Source: https://developer.roku.com/dev/docs/robot-framework-library Returns a list of installed apps on the Roku device. Each app object includes details such as title, ID, type, version, and subtype. ```APIDOC ## Get Apps ### Description Returns a list of installed apps as an array of objects. Each app object contains the following fields: title, id, type, version, subtype. ### Keyword `Get Apps` ### Example ```robotframework @{apps}=Get Apps ``` ``` -------------------------------- ### String Formatting Examples Source: https://developer.roku.com/dev/docs/iftostr Demonstrates formatting for strings, including enclosing in brackets, right-padding with spaces, and left-padding with spaces. ```brightscript s = "123" print s.ToStr("[%s]") '=> "[123]" print s.ToStr("<%5s>") '=> "< 123>" print s.ToStr("<% -5s>") '=> "<123 >" ``` -------------------------------- ### Get Device Info Example Source: https://developer.roku.com/dev/docs/robot-framework-library Retrieves general information about the Roku device. This includes details like vendor, model, language, country, and IP address. ```Robot Framework &{info}=Get device info ``` -------------------------------- ### Example main.brs file for SceneGraph Application Source: https://developer.roku.com/dev/docs/developing-scenegraph-applications This BrightScript file initializes and displays a SceneGraph scene. It sets up the screen, message port, and loads the 'rectangleScene'. ```brightscript sub Main() showChannelSGScreen() end sub sub showChannelSGScreen() print "in showChannelSGScreen" screen = CreateObject("roSGScreen") m.port = CreateObject("roMessagePort") screen.setMessagePort(m.port) scene = screen.CreateScene("rectangleScene") screen.show() while(true) msg = wait(0, m.port) msgType = type(msg) if msgType = "roSGScreenEvent" if msg.isScreenClosed() then return end if end while end sub ``` -------------------------------- ### AsyncGetToString() Source: https://developer.roku.com/dev/docs/ifurltransfer Starts an asynchronous GET request to a server. The response body is sent as an roUrlEvent to the object's message port upon completion. Returns a boolean indicating if the request was successfully issued. ```APIDOC ## AsyncGetToString() ### Description Starts a GET request to a server, but does not wait for the transfer to complete. When the GET request completes, a [roUrlEvent](https://developer.roku.com/dev/docs/rourlevent) will be sent to the message port associated with the object. The event will contain a roString with the body of the response. If false is returned then the request could not be issued and no events will be delivered. ### Return Value A flag indicating whether the request was issued. ``` -------------------------------- ### Set Environment Variables and Install App Source: https://developer.roku.com/dev/docs/hello-world Set the ROKU_DEV_TARGET and DEVPASSWORD environment variables, then navigate to the app directory and run 'make install'. ```bash % export ROKU_DEV_TARGET=192.168.1.140 % export DEVPASSWORD=1234 % cd/examples/source/videoplayer % make install ``` -------------------------------- ### GetUptime() Source: https://developer.roku.com/dev/docs/ifappmanager Retrieves an roTimespan object that marks when the user clicked the application button on the home screen. The TotalMilliseconds() method on the returned object can be used to get the total milliseconds since the application started. ```APIDOC ## GetUptime() ### Description Returns an [roTimespan](https://developer.roku.com/dev/docs/rotimespan) object, which is "marked" when the user clicked on the application button on the home screen. Calling the TotalMilliseconds() method on the returned roTimespan object returns the total number of milliseconds since the application started. ### Return Value An [roTimespan](https://developer.roku.com/dev/docs/rotimespan) object. ``` -------------------------------- ### Compile and Run External Control C Example (Linux/macOS) Source: https://developer.roku.com/dev/docs/external-control-api Compile and run the sample External Control Protocol C application on Linux or macOS. This involves navigating to the SDK directory, compiling the C file, and then executing the compiled program. ```bash $ cd SDK_directory $ gcc ./examples/rokuExternalControl.c -o rokuExternalControl $ ./rokuExternalControl ``` -------------------------------- ### Download and Run Roku Resource Monitor (Linux) Source: https://developer.roku.com/dev/docs/rrm-data-collection-mode This script downloads, extracts, and starts the Roku Resource Monitor in headless mode on a Linux system. It includes setup for D-Bus and virtual display environments. ```bash # DEVICE_IP - IP address of the Roku device (REQUIRED). # CHANNEL_ID - Channel to monitor (dev, or channel id). # PANELS - Performance panels to monitor (please refer documentation for details). # POLLING_INTERVAL - How often to collect metrics in seconds. # # ============================================================================== echo "Downloading latest release of a Roku Resource Monitor..." wget -O /rrm.tar.gz --progress=bar:force:noscroll \ https://devtools.web.roku.com/roku-resource-monitor/app/roku-resource-monitor-linux64.tar.gz echo "Extracting Roku Resource Monitor..." # Create RRM directory and extract archive contents # --strip-components=1 removes the top-level directory from the archive mkdir /RRM && tar -xf rrm.tar.gz --strip-components=1 -C /RRM echo "Starting Roku Resource Monitor in headless mode..." # Start D-Bus system daemon for inter-process communication # --system runs as system daemon, --fork runs in background dbus-daemon --system --fork # Start D-Bus session daemon and export its address for applications to use # This creates a session bus for the current user/session export DBUS_SESSION_BUS_ADDRESS=$(dbus-daemon --session --fork --print-address) # Disable X11 keyboard extension to prevent warnings in headless mode export XKB_DISABLE=1 # Launch RRM using xvfb-run for virtual display with comprehensive flags # xvfb-run -a automatically finds an available display number xvfb-run -a \ /RRM/roku_resource_monitor \ --no-sandbox \ --headless \ --disable-gpu \ --device-ip=$DEVICE_IP \ --channel-id=$CHANNEL_ID \ --polling-interval=$POLLING_INTERVAL \ --panels=$PANELS \ --output-file=/output ``` -------------------------------- ### Create and Query roDeviceInfo Source: https://developer.roku.com/dev/docs/rodeviceinfo Demonstrates how to create an roDeviceInfo object and retrieve its model, version, and channel client ID. ```brightscript di = CreateObject("roDeviceInfo") print di.GetModel() print di.GetVersion() print di.GetChannelClientId() ``` -------------------------------- ### Get Player Info Example Source: https://developer.roku.com/dev/docs/robot-framework-library Retrieves specific information about the Roku media player. This includes details about the device's vendor, model, language, country, IP address, and configured timeouts and delays. ```Robot Framework &{player}=Get player info ``` -------------------------------- ### Setting up a Video Node for Playlists Source: https://developer.roku.com/dev/docs/playing-videos Configure a Video node to play a sequence of media items by setting content and enabling playlist mode. This allows for sequential playback of multiple videos. ```brightscript m.video.content = contentNode m.video.contentIsPlaylist = true m.video.control = "play" ``` -------------------------------- ### Get Current Channel Info Example Source: https://developer.roku.com/dev/docs/robot-framework-library Retrieves detailed information about the currently loaded application on the Roku device. This includes session ID, status, and app-specific details like title, ID, version, and type. ```Robot Framework &{channel}=Get current channel info ``` -------------------------------- ### Simple Label Example Source: https://developer.roku.com/dev/docs/label-nodes A basic example demonstrating how to render a single line of text using the Label node. Configure text content, font, alignment, and position. ```xml ``` -------------------------------- ### Action Cards Dialog with Mixed Icon Types Source: https://developer.roku.com/dev/docs/std-dlg-action-card-item This example shows a complete dialog implementation with three different StdDlgActionCardItem nodes, each featuring a distinct iconType: 'none', 'more_info', and 'checkbox'. It includes BrightScript for initialization, palette setup, and handling card selections. ```xml ``` -------------------------------- ### Configure and Play Video in BrightScript Source: https://developer.roku.com/dev/docs/video Sets up video content properties such as URL, title, and stream format, then assigns it to a Video node and initiates playback. Ensure the Video node with the matching ID exists. ```brightscript sub init() m.top.setFocus(true) setVideo() end sub function setVideo() as void videoContent = createObject("RoSGNode", "ContentNode") videoContent.url = "https://roku.s.cpl.delvenetworks.com/media/59021fabe3b645968e382ac726cd6c7b/60b4a471ffb74809beb2f7d5a15b3193/roku_ep_111_segment_1_final-cc_mix_033015-a7ec8a288c4bcec001c118181c668de321108861.m3u8" videoContent.title = "Test Video" videoContent.streamformat = "hls" m.video = m.top.findNode("musicvideos") m.video.content = videoContent m.video.control = "play" end function ``` -------------------------------- ### Install App Parameters Source: https://developer.roku.com/dev/docs/web-driver Specifies parameters for installing an app on a Roku device. Requires the channelId of the app to be installed. ```json { "channelId": "dev" } ``` -------------------------------- ### Utility Function Creation Example Source: https://developer.roku.com/dev/docs/brightscript-doc Illustrates creating an associative array of utility functions. This example shows how to use special tags like {@literal}, {@code}, and {@br}, as well as linking to other functions. ```brightscript ' Creates an {@link roAssociativeArray associative array} of useful general utility functions. ' {@literal and are presented as is in this literal tag, rather than causing "and" to be bolded} ' {@code of course, the same thing is true in this code tag, but the font face is different ‐ and the matching tags are shown rather than cause the "and the matching" to be bolded} '
' And any old HTML you want to throw in is also valid, although equivalent BrightScriptDoc tags are more efficient... ' ' ' '
col 1col 2col 3
row 1 col 1row 1 col 2row 1 col 3
' And so on... ' @see .ShowCustomScreen#z The z variable in the ShowCustomScreen method is rather uninteresting ' @return an AA containing useful utility functions function CreateUtils() as Object aa = CreateObject("roAssociativeArray") aa.showcustom = ShowCustomScreen aa.foo = foo2 return aa end function ``` -------------------------------- ### Start Timer Source: https://developer.roku.com/dev/docs/javascript-library Starts the timer. Available since release 2.0. ```javascript library.markTimer(); ``` -------------------------------- ### Integer Formatting Examples Source: https://developer.roku.com/dev/docs/iftostr Demonstrates various printf-style format specifiers for integers, including decimal, zero-padding, and alignment. ```brightscript print 123.ToStr("%d") '=> "123" n = 300 + 45 print n.ToStr("The value is %d.") '=> "The value is 345." month = 7 print month.ToStr("%2d") '=> " 7" month = 8 print month.ToStr("%02d") '=> "08" month = 9 print month.ToStr("%-4d") '=> "9 " ``` -------------------------------- ### Install Python Requests Library Source: https://developer.roku.com/dev/docs/automated-channel-testing Installs the 'requests' HTTP library for Python, required by the sample WebDriver client application. Ensure Python 3.7 or higher is installed and pip is available. ```bash python -m pip install requests ``` -------------------------------- ### Install Roku Robot Framework Library Source: https://developer.roku.com/dev/docs/automated-channel-testing Install the Python version of the Roku Robot Framework Library locally to import it directly into Robot test case files. ```bash python pip install /automated-channel-testing-master/RobotLibrary ``` -------------------------------- ### Instantiate Roku Robot Framework Library Source: https://developer.roku.com/dev/docs/robot-framework-library Instantiate the Roku Robot Framework Library by providing the IP address, timeout, press delay, and path to the WebDriver. ```robotframework *** Settings *** Library ./../Library/RobotLibrary.py ${ip_address} ${timeout} ${pressDelay} ${server_path} *** Variables *** ${ip_address} 127.0.0.1 ${server_path} D:/path/to/webDriver/main.exe ${timeout} 20000 ${pressDelay} 2000 ``` ```python class RobotLibrary: def __init__(self, ip, timeout = 0, pressDelay = 0, path = ""): ``` -------------------------------- ### Instr Source: https://developer.roku.com/dev/docs/global-string-functions Finds the starting position of a substring within a text, starting from a specified position. ```APIDOC ## Instr(start as Integer, text as String, substring as String) as Integer ### Description Returns the position of the first instance of substring within text, starting at the specified start position. Returns 0 if the substring is not found. The first position in the text is considered 1. ### Parameters * **start** (Integer) - The position to start the search from. * **text** (String) - The string to search within. * **substring** (String) - The string to search for. ### Returns * (Integer) - The starting position of the first occurrence of the substring, or 0 if not found. ### Example ```brightscript print Instr(1, "this is a test", "t") ' prints: 1 print Instr(2, "this is a test", "t") ' prints: 11 print Instr(1, "this is a test", "is") ' prints: 3 ``` ``` -------------------------------- ### Load and Initialize SSAI Adapter Source: https://developer.roku.com/dev/docs/ssai-adapters Instantiate and initialize the SSAI adapter with the appropriate name. Supported adapter names include uplynk, adobe, onceux, yospace, awsemt, and ggldai. ```brightscript adapter = RAFX_SSAI({name:"uplynk"}) ' Supported: uplynk, adobeonceux, yospace, awsemt, ggldai adapter.init() ```