DoNotDisplay Condition Cookbook

Individual videos, lists of videos, and other items in SDK channels each have a DoNotDisplay parameter. If the DoNotDisplay parameter is set to "no" (the default value) then the item will be displayed normally. However if DoNotDisplay is set to "yes", then the item will be hidden from the channel, and will not be displayed to viewers. If a list of items has its DoNotDisplay parameter set to "yes", then the list and all items beneath it will not be displayed. The DoNotDisplay parameter is often used to temporarily remove an item or list of items from a channel, without actually deleting it.

In order to make the DoNotDisplay parameter more flexible, the Condition parameter can be used to conditionally apply the DoNotDisplay parameter by setting the DoNotDisplay parameter to "yes if condition is true". For example, a Condition can be used to display a video only after a specified date.

The remainder of this Help page is a "cookbook", containing "recipes" for the Condition parameter to be used in specific situations.


  • AFTER or BEFORE a Date and Time

    An item can be displayed before or after a specified date and time.

    Example: Do not display an item after December 1, 2020 at 2:30PM. Set DoNotDisplay to "yes if condition is true" and enter the following into the Condition textbox:

    after 2020-12-01 14:30:00

    Example: Do not display an item before December 1, 2020 at 2:30PM. Set DoNotDisplay to "yes if condition is true" and enter the following into the Condition textbox:

    before 2020-12-01 14:30:00

    The time comparison uses the date and time that the viewer launched the channel from the Roku home screen. The Theme ScheduleTimeZone parameter determines whether the Condition time is interpreted as a GMT time or as a local (to the Roku device) time.

  • BETWEEN two Dates and Times

    An item can be displayed or not displayed between two specified dates and times.

    Example: Display an item between December 1, 2020 at midnight and January 1, 2021 at midnight. Set DoNotDisplay to "yes if condition is true" and enter the following into the Condition textbox:

    ! between 2020-12-01 00:00:00, 2021-01-01 00:00:00

    Placing an exclamation point (!) before the condition negates it, allowing the item to be displayed when the condition is true. The two dates are separated by a comma.

    Example: Do not display an item between December 1, 2020 at midnight and January 1, 2021 at midnight. Set DoNotDisplay to "yes if condition is true" and enter the following into the Condition textbox:

    between 2020-12-01 00:00:00, 2021-01-01 00:00:00

    The two dates are separated by a comma.

    The time comparison uses the date and time that the viewer launched the channel from the Roku home screen. The Theme ScheduleTimeZone parameter determines whether the Condition time is interpreted as a GMT time or as a local (to the Roku device) time.

  • Specifying Times without Dates

    Date and Time conditions can be specified without using a date. When the date is not specified, the time comparison is made without regard for the current date.

    Example: Do not display an item before 4:00PM. Set DoNotDisplay to "yes if condition is true" and enter the following into the Condition textbox:

    before 16:00:00

    The time comparison uses the time that the viewer launched the channel from the Roku home screen. The Theme ScheduleTimeZone parameter determines whether the Condition time is interpreted as a GMT time or as a local (to the Roku device) time.

  • Auto-play Video

    The 'Auto-play video' setting in a Roku device is a user-configurable setting that disables auto-play videos in a channel/app. The value of this setting can be tested using the "isautoplayallowed" or "isapallowed" Condition. This can be used with a Picture Screen item or a short Video item placed at the top of the channel to display a warning to users if they have 'Auto-play video' disabled.

    Example: Display an item if the user has disabled 'Auto-play video'. Set DoNotDisplay to "yes if condition is true" and enter the following into the Condition textbox:

    isapallowed

    Example: Display an item if the user has enabled 'Auto-play video'. Set DoNotDisplay to "yes if condition is true" and enter the following into the Condition textbox:

    ! isapallowed

    Placing an exclamation point (!) before the condition negates it, allowing the item to be displayed when the condition is true.

    It is not necessary to use DoNotDisplay to prevent auto-play videos from playing when the viewer has 'Auto-play video' disabled in their Roku device. If the Theme AutomaticPlayWarningEnabled parameter is set to "True" and the viewer has 'Auto-play video' disabled, then any auto-play lists will be preceded by a warning and all non-Springboard trailer videos and background videos will be disabled regardless of any DoNotDisplay conditions.

  • Client ID

    An item can be displayed or not displayed based on the channel's Client ID.

    Each channel on a Roku device has a unique 36-character Client ID. The Client ID is unique to each channel and on each Roku device, the same channel will have a different Client ID on each Roku device on which it is installed. The Client ID is permanent and cannot be changed by the user.

    Example: Do not display an item if the Roku device has a specific Client ID. This will prevent an item from being displayed on the one Roku device with the specified Client ID. Set DoNotDisplay to "yes if condition is true" and enter the following into the Condition textbox:

    clientId = 12345679-1234-1234-1234-123456789012

    Example: Display an item if the Roku device has a specific Client ID. This will display the item on the one Roku device with the specified Client ID. Set DoNotDisplay to "yes if condition is true" and enter the following into the Condition textbox:

    ! clientId = 12345679-1234-1234-1234-123456789012

    Placing an exclamation point (!) before the condition negates it, allowing the item to be displayed when the condition is true.

    Example: Display an item if the Roku device has one of several Client IDs. This will display the item on either of the two Roku devices with one of the specified Client IDs. Set DoNotDisplay to "yes if condition is true" and enter the following into the Condition textbox:

    ! clientId = 12345678-1234-1234-1234-123456789012, 87654321-4321-4321-4321-210987654321

    When specifying two or more Client IDs, the Client IDs are separated by commas. Placing an exclamation point (!) before the condition negates it, allowing the item to be displayed when the condition is true.

    You can determine the Client ID of a channel on a particular Roku device by temporarily setting the Theme ShowDebugClientId parameter to "yes". This will cause the Client ID to be displayed on the TV screen when the channel is running.

  • Country Code

    An item can be displayed or not displayed based on the the ISO 3166-1 (2-letter) country code associated with the user's Roku account. This can be useful when licensing restricts a video to being displayed only in a particular geographic region.

    Example: Allow the item to be displayed only if the user's country code is "US", "CA", or "MX" (United States, Canada, or Mexico). Set DoNotDisplay to "yes if condition is true" and enter the following into the Condition textbox:

    ! country = US, CA, MX

    When specifying two or more country codes, the country codes are separated by commas. Placing an exclamation point (!) before the condition negates it, allowing the item to be displayed when the condition is true.

    Example: Do not allow the item to be displayed if the user's country code is "US" (United States). Set DoNotDisplay to "yes if condition is true" and enter the following into the Condition textbox:

    country = US

    Example: Do not allow the item to be displayed if the user does not have a Roku-supported country code. Set DoNotDisplay to "yes if condition is true" and enter the following into the Condition textbox:

    country = OT

    Roku only supports country codes where their devices are generally available. Unsupported countries are represented by a code of "OT" (Other).

  • Installed

    An item can be displayed or not displayed based on whether or not a particular Roku channel/app has been installed on the device. This can be used to display Programmable Buttons and video Ads for other channels only if the other channel has not already been installed.

    Example: Do not display an item if Clutch Cargo (which has App ID 41985) is installed on the device. Set DoNotDisplay to "yes if condition is true" and enter the following into the Condition textbox:

    installed = 41985

    Example: Display an item only if Clutch Cargo (which has App ID 41985) is installed on the device. Set DoNotDisplay to "yes if condition is true" and enter the following into the Condition textbox:

    ! installed = 41985

    Placing an exclamation point (!) before the condition negates it, allowing the item to be displayed when the condition is true.

    Example: Display an item only if either Clutch Cargo (which has App ID 41985) or Retro Tech Time Machine (which has App ID 39210) are installed on the device. Set DoNotDisplay to "yes if condition is true" and enter the following into the Condition textbox:

    ! installed = 41985, 39210

    When specifying two or more App IDs, the Product IDs are separated by commas. Placing an exclamation point (!) before the condition negates it, allowing the item to be displayed when the condition is true.

    The App ID for a channel/app, also referred to as "Channel ID", can be found in Roku Developer Account containing the channel/app.

  • Purchased

    An item can be displayed or not displayed based on whether or not a particular In-Channel Purchasing Product ID has been purchased. This can be useful for displaying Programmable Buttons configured for purchasing only if a particular item has yet to be purchased. It can also be used to display premium content items, including lists of items, only if a Product ID has been purchased, or free sample items can be hidden after a Product ID has been purchased.

    Because the state of a Product ID (purchased or not purchased) is only checked when the channel is first started, it may be necessary to restart a channel after a purchase has been made if using this type of Condition. A channel can be restarted by using the PurchaseSuccess "restart channel" option in Programmable Buttons configured for purchasing, or by using the After Purchase "restart the channel" option in Springboard Purchase buttons.

    Example: Do not display an item if a specific Product ID has been purchased. Set DoNotDisplay to "yes if condition is true" and enter the following into the Condition textbox:

    purchased = PID1

    Example: Display an item if a specific Product ID has been purchased. Set DoNotDisplay to "yes if condition is true" and enter the following into the Condition textbox:

    ! purchased = PID1

    Placing an exclamation point (!) before the condition negates it, allowing the item to be displayed when the condition is true.

    Example: Display an item if any of several Product IDs have been purchased. Set DoNotDisplay to "yes if condition is true" and enter the following into the Condition textbox:

    ! purchased = PID1, PID2, PID3

    When specifying two or more Product IDs, the Product IDs are separated by commas. Placing an exclamation point (!) before the condition negates it, allowing the item to be displayed when the condition is true.

  • RIDA (Roku ID for Advertisers)

    An item can be displayed or not displayed based on the Roku device's RIDA.

    Each Roku device has a unique 36-character RIDA. The RIDA is similar to a serial number, except that for privacy reasons the RIDA can be changed by the user to a new unique value from the Roku device's System menu.

    Example: Do not display an item if the Roku device has a specific RIDA. This will prevent an item from being displayed on the one Roku device with the specified RIDA. Set DoNotDisplay to "yes if condition is true" and enter the following into the Condition textbox:

    rida = 12345679-1234-1234-1234-123456789012

    Example: Display an item if the Roku device has a specific RIDA. This will display the item on the one Roku device with the specified RIDA. Set DoNotDisplay to "yes if condition is true" and enter the following into the Condition textbox:

    ! rida = 12345679-1234-1234-1234-123456789012

    Placing an exclamation point (!) before the condition negates it, allowing the item to be displayed when the condition is true.

    Example: Display an item if the Roku device has one of several RIDAs. This will display the item on either of the two Roku devices with one of the specified RIDAs. Set DoNotDisplay to "yes if condition is true" and enter the following into the Condition textbox:

    ! rida = 12345678-1234-1234-1234-123456789012, 87654321-4321-4321-4321-210987654321

    When specifying two or more RIDAs, the RIDAs are separated by commas. Placing an exclamation point (!) before the condition negates it, allowing the item to be displayed when the condition is true.

    The free "What's My RIDA" Roku channel can be used to display a device's RIDA. You can also determine the RIDA of a Roku device by temporarily setting the Theme ShowDebugRida parameter to "yes". This will cause the RIDA to be displayed on the TV screen when the channel is running.

  • Roku TV

    An item can be displayed or not displayed based on whether or not the channel is running on a Roku TV (a TV with a built-in Roku device).

    Example: Do not display an item if the channel is running on a Roku TV. Set DoNotDisplay to "yes if condition is true" and enter the following into the Condition textbox:

    isTV

    Example: Display an item if the channel is running on a Roku TV. Set DoNotDisplay to "yes if condition is true" and enter the following into the Condition textbox:

    ! isTV

    Placing an exclamation point (!) before the condition negates it, allowing the item to be displayed when the condition is true.

  • Display Mode

    The display device's resolution can be used to determine whether or not to display an item.

    Example: Do not display an item if the display resolution is 1280x720 or higher. Set DoNotDisplay to "yes if condition is true" and enter the following into the Condition textbox:

    isHD

    isHD evaluates to True (do not display) if the display resolution is 1280x720 or higher.

    Example: Display an item if the display resolution is 1280x720 or higher. Set DoNotDisplay to "yes if condition is true" and enter the following into the Condition textbox:

    ! isHD

    isHD evaluates to True (do not display) if the display resolution is 1280x720 or higher. Placing an exclamation point (!) before the condition negates it, allowing the item to be displayed when the condition is true.

    Example: Do not display an item if the display resolution is 1920x1080 or higher. Set DoNotDisplay to "yes if condition is true" and enter the following into the Condition textbox:

    isFHD

    isFHD evaluates to True (do not display) if the display resolution is 1920x1080 or higher.

    Example: Display an item if the display resolution is 1920x1080 or higher. Set DoNotDisplay to "yes if condition is true" and enter the following into the Condition textbox:

    ! isFHD

    isFHD evaluates to True (do not display) if the display resolution is 1920x1080 or higher. Placing an exclamation point (!) before the condition negates it, allowing the item to be displayed when the condition is true.

    Example: Display an item if the display resolution is less than 1280x720 (SD). This is the same as the first isHD example which prevented the item from being displayed if the resolution was 1280x720 or higher. Set DoNotDisplay to "yes if condition is true" and enter the following into the Condition textbox:

    isHD

    isHD evaluates to True (do not display) if the display resolution is 1280x720 or higher, and it evaluates to False (do display) if the display resolution is less than 1280x720.

  • Low Memory Device

    Sometimes it is desirable to prevent complex portions of a channel from being displayed on older Roku hardware with lower amounts of memory or slower processors. The use of this Condition is only necessary if portions of the channel crash or become sluggish on older Roku devices.

    Roku devices which are considered "low-memory" are models 2400, 2450, 2500, 2700, 2710, 2720, 3000, 3050, and 3100.

    Example: Do not display an item if the channel is running on a "low-memory" Roku device. Set DoNotDisplay to "yes if condition is true" and enter the following into the Condition textbox:

    isLowMemory


The Roku Developer Forum is a useful resource for Roku channel developers, and is a great place to ask questions.

Want to know more about how to build an SDK Roku channel? Check out this Roku Custom SDK Walk-Through for all of the details.


Instant TV Channel is a cloud-based tool for Roku developers and content providers that shortens development time and eases maintenance after deployment.


Subtitles

If you are considering subtitles for your Roku video content, our sister-site InstantSubtitles.com provides an easy-to-use and inexpensive solution. Click here for more information.




Access Code: ID1
Check out Instant TV Channel by adding our latest demonstration channel to your Roku player.



Instant TV Channel is not affiliated with nor endorsed by Roku Inc.