---
title: Player APIs (BrightScript & JavaScript)
slug: develop/player-apis-brightscript-and-javascript
docTags: 
createdAt: 2025-03-11T07:07:17.199Z
---

## BrightScript vs. JavaScript

When developing for BrightSign players, you must write in BrightScript at some point (unless you are using BrightSign Author) though most users are not familiar with this language. Traditionally, every application, presentation, video, etc. that ran on a player was driven by BrightScript. Since most users today want to use JavaScript to develop applications and control the player, BrightSign has been working to accommodate that. Nevertheless, BrightScript remains integral because without an `autorun.brs` file, written in BrightScript, your player will not behave as intended.

The [BrightScript Language](https://marketplace.visualstudio.com/items?itemName=RokuCommunity.brightscript) extension in Visual Studio Code facilitates BrightScript coding and is used by thousands of developers around the world.

## Why BrightScript is Required

`autorun.brs` is the generic name for a file the BrightSign Operating System (BOS) searches for on the player’s configured storage device (see Image 1, below). If an `autorun.brs` is found, the player will execute it. It is the entry point for any application developed on a BrightSign player, and it can handle the entirety of an application (BrightSign Author), be a simple pointer to more complex programs (JavaScript applications), or any mix of the two.

The BrightSign `autorun.brs` also configures the player. Many player setup/configuration options must be set up immediately (such as SSH, logging level, some network interfaces, registry settings, video decoder routing, etc.). These settings are unique to media players, and because the `autorun.brs` is the first thing the player executes, it is the best (and sometimes only) place to set them.

When creating a JavaScript application or presentation, the `autorun.brs` will typically configure the player, instantiate an HTML widget, and give the HTML widget the correct HTML file or URL. The HTML widget will then take over and run your JavaScript files.

![Screenshot 2025-01-07 at 11.16.48 AM.png](https://api.archbee.com/api/optimize/511c8QBH-VHiwWnyzIwUb/1fEuo_zkz9Kq_QD2mz_CI_screenshot-2025-01-07-at-111648-am.png)

## When to Use BrightScript

### BrightScript Required

BrightScript is required for these scenarios:

- Player setup/configuration that must be done before a JavaScript application or presentation is loaded
  - Setting up logging level
  - Instantiating the HTML widget
  - Setting up network interfaces (on certain ports)
  - Certain file system operations
- BrightSign Author plugins
- Autorun logging level and BOS logging (serial)
- Any BrightScript object that doesn’t have a JavaScript alternative. A list of BrightScript objects and their JavaScript alternatives is [here](docId:2KEwWxLmpYcwu8tffuf2Z).

### BrightScript Recommended

Though JavaScript can be used, BrightScript is recommended in these scenarios:

- Player setup/configuration that is not time dependent, such as setting up SSH/Telnet or setting up network interfaces on main ports
- Player sync

