# Debugging checklist

Source: https://dev.arcxp.com/video-center/developer-docs/video-center-player-debugging-checklist/

Video Center Player - Debugging checklist

This page describes common Video Center player issues, lists troubleshooting tools, and provides debugging tips. If your scenario is not listed and you are unable to fully debug Video Center Player issues, contact [Arc XP Customer Support](https://support.arcpublishing.com/).

## Prerequisites

To fully debug Video Center Player issues, you must be able to:

- Bring up the JS console
- Interact with JS objects
- Use the browser element inspector
- Use the browser network tab

> **Important:**
> 
> When submitting a Video Center Player bug ticket, provide the URL of the page where you first observed the issue.

## Common issues

This section describes the Video Center player common issues and possible causes, and includes possible solutions.

### Errors while instantiating the player

**Potential cause:** Issues with imported videos and mismatch between video bitrate and max bitrate setting

**Troubleshooting**

- Check event log to validate that this is the actual issue (link to error doc). The event ID will be 930\. If not, look at other potential causes.
- If the event ID is 930, either have the client adjust the Max Bitrate to something higher (see window.PoWaSettings section below), or lower the bitrate for the transcoding of the video.

### Errors with ads

**Potential cause:** Issues with pre-roll ads

> **Tip:**
> 
> First, check if the player is at fault (see the [IMA debugger](#ima-debugger) section)

**Troubleshooting**

The player employs four scripts to run video on a page:

- `powa.js`
- `powaDrive.js`
- `powaBoot.js`
- `{org}.js`

The three “powa” scripts are available under `https://{org}.video-player.arcpublishing.com/{prod|sandbox}/{script}.js` and the “org config” script should be available under `https://{org}.video-player.arcpublishing.com/{prod|sandbox}/org/{org}.js`.

The player itself is `powa.js`. It plays videos and ads. It doesn’t know about Video Center, Arc, Arc XP Native Specification (ANS), or what a UUID is; it just plays videos and ads. If you want to create a video player for a video or stream that is not hosted by Video Center, you can use `powa.js` to create a “raw” player.

`powaDrive.js` wraps `powa.js` and _does_ know about Video Center, Arc, and ANS. `powaDrive.js` makes the request to the Video API to fetch the ANS for a UUID and parses that response to instantiate a player with `powa.js`. It also maintains any playlists that may be employed.

`powaBoot.js` is a script that, on page load or when it is loaded, scans the page for any elements with a class of `powa` and _boots_ a player up upon that element. At a minimum the “powa” element must have a `data-org="{org}"` attribute and a `data-uuid="{uuid}"` attribute. With these two values _powaBoot_ can obtain the organization’s player config script (`{org}.js`) and instantiate an instance of _powaBoot_ with the desired UUID.

The `{org}.js` script contains all of the player configurations particular to an organization. Any configurations or customizations for the player must live here. Sometimes these configurations and customizations reside external to this script (e.g. in a React component or on the page itself), which can make debugging a little more difficult.

## Client-side tools

This section describes the client-side tools you can use for troubleshooting.

### Network tab

If any of the “powa” scripts cannot be obtained, it is possible Video Center has not been provisioned for the organization. If the “org” script cannot be obtained, it’s possible the Video Center player has not been provisioned for the org. If the Video ANS for the UUID cannot be obtained, it’s possible the video has not been published or that it has exceeded its _pubEndDate_.

### window.powas

Any players that are created on a page get stashed on the `window.powas` object. This object is keyed to the id of the _powa_ element. The value of that key is another object which contains a reference to the `powa` instance (i.e. the player), a reference to the `powaTrack` array, and a reference to the `powaTracked` array.

The _powa_ instance is the player. All player methods are available via this reference (e.g. `powa.getStatus()`).

The `powaTrack` array is a log of the events emitted by the _powa_ instance. It contains the event payload and timing information.

The `powaTracked` array is a log of the previous video the player played (if there was one).

### window.powaData

Any Video ANS data obtained via one of the Video APIs gets stashed to `window.powaData` keyed on the UUID of the video. This is also a valuable source of information for `MediaTailor` streams as data concerning the ads stitched into the stream is stashed here as well.

### window.PoWaSettings

Player settings are referenced via `window.PoWaSettings`. Configurations such as `maxBitrate` and `streamPreference` are located on this object. The `adTag` function and general ad settings are defined on `PoWaSettings.advertising`. Player templates are hosted here (e.g. promo).

## Debugging tips

### powaEmbed.html

If something else on the host page is interfering with the player (e.g. CSS), one way to determine that the player itself is fine is to use `powaEmbed.html`. This page is hosted for all orgs at `https://{org}.video-player.arcpublishing.com/{prod|sandbox}/powaEmbed.html?org={org}&uuid={uuid}`. Some organizations define their player CSS external to the player, so you may need to append the query string attribute `powa-promo=default` in order for the player to render properly.

### IMA debugger

If the pre-roll ad is not working properly, one way to determine if the player is possibly at fault is to test the ad tag request URL in [Google's IMA debugger](https://googleads.github.io/googleads-ima-html5/vsi/). The `adTagURL` field from an ad event can be obtained from any of the ad events from `powaTrack`.
