Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin' into smp-imscjs-1.0.11
Browse files Browse the repository at this point in the history
  • Loading branch information
jlks committed Jun 19, 2024
2 parents c7e2db3 + 04a6dd1 commit e2e1a34
Show file tree
Hide file tree
Showing 93 changed files with 8,565 additions and 7,217 deletions.
33 changes: 15 additions & 18 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
# unsupported
*.html
*.md
*.sh
*.yaml
# Exclude everything
*

# deps
node_modules/

# build
docs/
dist/
dist-local/

# configs
.nvmrc
*.config.*
rollup.*.js
.*ignore
# Re-include supported file formats and locations
!./*.js
!./*.cjs
!./*.mjs
!./*.ts
!./*.cts
!./*.mts
!src/**/*.js
!src/**/*.cjs
!src/**/*.mjs
!src/**/*.ts
!src/**/*.cts
!src/**/*.mts
167 changes: 0 additions & 167 deletions .eslintrc.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
node_modules/

# build
docs/
dist/
dist-local/
docs/api/
5 changes: 3 additions & 2 deletions .prettierrc.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
semi: false
tabWidth: 2
endOfLine: lf
printWidth: 120
singleQuote: false
trailingComma: "es5"
trailingComma: es5
bracketSameLine: true
endOfLine: "lf"
quoteProps: consistent
overrides:
- files:
- "*.html"
Expand Down
2 changes: 1 addition & 1 deletion babel.config.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"presets": [["@babel/preset-env"]]
"presets": [["@babel/preset-env"], ["@babel/preset-typescript"]]
}
2 changes: 1 addition & 1 deletion docs/tutorials/02-settings-and-overrides.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ type failoverResetTime = number is FiniteNumber
Provide a sorting algorithm to reorder the available media sources after a failover.
```ts
type failoverSort = (...sources: [...string]) => [...string]
type failoverSort = (sources: string[]) => string[]
```
### `streaming.seekDurationPadding`
Expand Down
24 changes: 19 additions & 5 deletions docs/tutorials/Debugging.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
During development, `bigscreen-player` offers a form of debugging with an on-screen debugger. Using this tool, specific events can be monitored to check successful execution of the program logic. This is particularly useful where no native JS consoles are accessible on certain devices.
BigscreenPlayer offers logging through "Chronicle", our own debugging solution. This tool can be used to monitor specific events and changes in metrics over time in order to validate execution of the program logic.

## On-Screen Debugging

We offer an on-screen debugger as part of our solution. This is particularly useful where no native JavaScript consoles are natively accessible on devices.

The on-screen debugger can be shown using:
```

```js
bigscreenPlayer.toggleDebug()
```

### The Chronicle
The debug-tool latches on top of the `chronicle` which acts similarly to the plugin interface. It has a reference to all of the callbacks that need to be updated upon a debug event occurring.
## Structured Logging

Logs in the Chronicle are _structured_. What is more, logs are captured even when the on-screen debugger isn't active. You can access the complete record of the playback session using:

```js
bigscreenPlayer.getDebugLogs()
```

You can find the full structure of the data returned by this function in the source file `chronicle.ts`. In short, `getDebugLogs` returns the Chronicle record as a flat array of entries. Each entry falls into one of three (3) categories:

This could allow for a possible extension of the debugging interface *if* needed.
1. Message: Unstructured string data. Think `console` output.
2. Metrics: Values that change over time, such as dropped frames.
3. Traces: Snapshots and one-of data, such as errors and events.
3 changes: 3 additions & 0 deletions docs/tutorials/tutorials.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
"cdn-failover": {
"title": "CDN Failover"
},
"debugging": {
"title": "Debugging"
},
"live-streaming": {
"title": "Live"
}
Expand Down
19 changes: 19 additions & 0 deletions eslint.compat.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { FlatCompat } from "@eslint/eslintrc"
import js from "@eslint/js"
import path from "node:path"
import { fileURLToPath } from "node:url"

// Mimick CommonJS variables
const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)

const compat = new FlatCompat({
baseDirectory: __dirname,
resolvePluginsRelativeTo: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
})

export const sonarjs = {
configs: { recommended: compat.extends("plugin:sonarjs/recommended") },
}
Loading

0 comments on commit e2e1a34

Please sign in to comment.