Skip to content

Commit 9ed6e25

Browse files
committed
[Proposal] Remove standalone demo
The RxPlayer historically proposed two demo: - The "full" demo, containing a whole application relying on the RxPlayer to load content. Which also corresponds to our advertised RxPlayer demo page on github: https://developers.canal-plus.com/rx-player/ - The "standalone" demo, which is just an HTML page containing a default RxPlayer bundle script and a video element, allowing to perform playback tests through the console. We never really relied on the standalone demo, any kind of test we perform being on any case either on the full demo, or directly linked to final applications developped internally at Canal+. Consequently to simplify the repository maintainance, I propose here to remove the standalone demo and to move the full demo from the `demo/full` directory to just `demo/`.
1 parent cc11ffc commit 9ed6e25

File tree

94 files changed

+78
-306
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+78
-306
lines changed

.eslintignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@ node_modules
22
*.log
33
*.keys
44

5-
demo/full/bundle.js
6-
demo/full/lib.js
7-
demo/standalone/lib.js
85
demo/bundle.js
6+
demo/lib.js
97

108
tools/tests/coverage/
119

.gitignore

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
/localhost.key
44
/node_modules
55

6-
/demo/full/bundle.js
7-
/demo/full/worker.js
8-
/demo/standalone/lib.js
6+
/demo/bundle.js
7+
/demo/worker.js
98

109
/tests/performance/node_modules
1110
/tests/performance/bundle1.js

CONTRIBUTING.md

Lines changed: 13 additions & 30 deletions

FILES.md

Lines changed: 1 addition & 9 deletions
File renamed without changes.

demo/README.md

Lines changed: 2 additions & 11 deletions
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

demo/full/scripts/components/BufferContentGraph.tsx renamed to demo/scripts/components/BufferContentGraph.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as React from "react";
2-
import type { IVideoRepresentation } from "../../../../src/public_types";
2+
import type { IVideoRepresentation } from "../../../src/public_types";
33
import capitalizeFirstLetter from "../lib/capitalizeFirstLetter";
44
import shuffleArray from "../lib/shuffleArray";
55
import ToolTip from "./ToolTip";

demo/full/scripts/components/Options/AudioAdaptiveSettings.tsx renamed to demo/scripts/components/Options/AudioAdaptiveSettings.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as React from "react";
2-
import { IAudioRepresentationsSwitchingMode } from "../../../../../src/public_types";
2+
import { IAudioRepresentationsSwitchingMode } from "../../../../src/public_types";
33
import Select from "../Select";
44

55
/**

demo/full/scripts/components/Options/VideoAdaptiveSettings.tsx renamed to demo/scripts/components/Options/VideoAdaptiveSettings.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as React from "react";
2-
import { IVideoRepresentationsSwitchingMode } from "../../../../../src/public_types";
2+
import { IVideoRepresentationsSwitchingMode } from "../../../../src/public_types";
33
import Checkbox from "../../components/CheckBox";
44
import Select from "../Select";
55

File renamed without changes.

demo/full/scripts/controllers/ContentList.tsx renamed to demo/scripts/controllers/ContentList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import DEFAULT_CONTENTS from "../contents";
1717
import type { IDefaultContent, IDrmInfo } from "../contents";
1818
import GeneratedLinkURL from "../components/GenerateLinkURL";
1919
import GenerateLinkButton from "../components/GenerateLinkButton";
20-
import type { IKeySystemOption, ILoadVideoOptions } from "../../../../src/public_types";
20+
import type { IKeySystemOption, ILoadVideoOptions } from "../../../src/public_types";
2121

2222
/* eslint-disable */
2323
const win = window as any;

demo/full/scripts/controllers/Main.tsx renamed to demo/scripts/controllers/Main.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import RxPlayer from "../../../../src/minimal";
1+
import RxPlayer from "../../../src/minimal";
22
import * as React from "react";
33
import GitHubButton from "../components/GitHubButton";
44
import Player from "./Player";

demo/full/scripts/controllers/Player.tsx renamed to demo/scripts/controllers/Player.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
import * as React from "react";
2+
import type {
3+
IAudioRepresentationsSwitchingMode,
4+
ILoadVideoOptions,
5+
IVideoRepresentationsSwitchingMode,
6+
} from "../../../src/public_types";
27
import PlayerModule from "../modules/player";
38
import type { IPlayerModule } from "../modules/player";
49
import ControlBar from "./ControlBar";
@@ -12,11 +17,6 @@ import type {
1217
ILoadVideoSettings,
1318
IConstructorSettings,
1419
} from "../lib/defaultOptionsValues";
15-
import type {
16-
IAudioRepresentationsSwitchingMode,
17-
ILoadVideoOptions,
18-
IVideoRepresentationsSwitchingMode,
19-
} from "../../../../src/public_types";
2020

2121
const { useCallback, useEffect, useRef, useState } = React;
2222

demo/full/scripts/controllers/Settings.tsx renamed to demo/scripts/controllers/Settings.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import type {
1414
IAudioRepresentationsSwitchingMode,
1515
ICmcdOptions,
1616
IVideoRepresentationsSwitchingMode,
17-
} from "../../../../src/public_types";
17+
} from "../../../src/public_types";
1818

1919
const { useCallback } = React;
2020

demo/full/scripts/controllers/knobs/AudioRepresentation.tsx renamed to demo/scripts/controllers/knobs/AudioRepresentation.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as React from "react";
2-
import { IAudioRepresentation } from "../../../../../src/public_types";
2+
import { IAudioRepresentation } from "../../../../src/public_types";
33
import Knob from "../../components/Knob";
44
import useModuleState from "../../lib/useModuleState";
55
import type { IPlayerModule } from "../../modules/player/index";

demo/full/scripts/controllers/knobs/AudioTrack.tsx renamed to demo/scripts/controllers/knobs/AudioTrack.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import * as React from "react";
2+
import type { IAudioTrack, IAvailableAudioTrack } from "../../../../src/public_types";
23
import translateAudioTrackCode from "../../lib/translateLanguageCode";
34
import Knob from "../../components/Knob";
45
import useModuleState from "../../lib/useModuleState";
56
import type { IPlayerModule } from "../../modules/player/index";
6-
import type { IAudioTrack, IAvailableAudioTrack } from "../../../../../src/public_types";
77

88
const AUDIO_DESCRIPTION_ICON = "(AD)"; // String.fromCharCode(0xf29e);
99

demo/full/scripts/controllers/knobs/Subtitles.tsx renamed to demo/scripts/controllers/knobs/Subtitles.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import * as React from "react";
2+
import type { ITextTrack, IAvailableTextTrack } from "../../../../src/public_types";
23
import translateLanguageCode from "../../lib/translateLanguageCode";
34
import Knob from "../../components/Knob";
45
import useModuleState from "../../lib/useModuleState";
56
import type { IPlayerModule } from "../../modules/player/index";
6-
import type { ITextTrack, IAvailableTextTrack } from "../../../../../src/public_types";
77

88
const CLOSED_CAPTION_ICON = "(CC)"; // String.fromCharCode(0xf2a4);
99

demo/full/scripts/controllers/knobs/VideoRepresentation.tsx renamed to demo/scripts/controllers/knobs/VideoRepresentation.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as React from "react";
2-
import { IVideoRepresentation } from "../../../../../src/public_types";
2+
import { IVideoRepresentation } from "../../../../src/public_types";
33
import Knob from "../../components/Knob";
44
import useModuleState from "../../lib/useModuleState";
55
import type { IPlayerModule } from "../../modules/player/index";

demo/full/scripts/controllers/knobs/VideoTrack.tsx renamed to demo/scripts/controllers/knobs/VideoTrack.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import * as React from "react";
2+
import type { IVideoTrack, IAvailableVideoTrack } from "../../../../src/public_types";
23
import Knob from "../../components/Knob";
34
import useModuleState from "../../lib/useModuleState";
45
import type { IPlayerModule } from "../../modules/player/index";
5-
import type { IVideoTrack, IAvailableVideoTrack } from "../../../../../src/public_types";
66

77
function findVideoTrackIndex(
88
videoTrack: IVideoTrack,
File renamed without changes.
File renamed without changes.

demo/full/scripts/lib/defaultOptionsValues.ts renamed to demo/scripts/lib/defaultOptionsValues.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type {
22
ICmcdOptions,
33
IConstructorOptions,
44
ILoadVideoOptions,
5-
} from "../../../../src/public_types";
5+
} from "../../../src/public_types";
66

77
const defaultOptionsValues = {
88
player: {
File renamed without changes.

demo/full/scripts/lib/parseDRMConfigurations.ts renamed to demo/scripts/lib/parseDRMConfigurations.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { IKeySystemOption } from "../../../../src/public_types";
1+
import type { IKeySystemOption } from "../../../src/public_types";
22
import { utf8ToStr, strToUtf8, leUtf16ToStr } from "./bytes";
33

44
export default async function parseDRMConfigurations(
File renamed without changes.
File renamed without changes.

demo/full/scripts/modules/player/catchUp.ts renamed to demo/scripts/modules/player/catchUp.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Distance from live edge we try to reach when the catching up button
22

33
import type { IPlayerModuleState } from ".";
4-
import type RxPlayer from "../../../../../src";
4+
import type RxPlayer from "../../../../src";
55
import type { IStateUpdater } from "../../lib/declareModule";
66

77
// is enabled.

demo/full/scripts/modules/player/events.ts renamed to demo/scripts/modules/player/events.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import type { IPlayerModuleState } from ".";
2-
import type RxPlayer from "../../../../../src";
2+
import type RxPlayer from "../../../../src";
33
import type {
44
IBrokenRepresentationsLockContext,
55
IPlayerError,
66
IVideoTrack,
7-
} from "../../../../../src/public_types";
7+
} from "../../../../src/public_types";
88
import type { IStateUpdater } from "../../lib/declareModule";
99

1010
const POSITION_UPDATES_INTERVAL = 100;

demo/full/scripts/modules/player/index.ts renamed to demo/scripts/modules/player/index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ import {
1818
HTML_TTML_PARSER,
1919
HTML_VTT_PARSER,
2020
SMOOTH,
21-
} from "../../../../../src/features/list";
22-
import { METAPLAYLIST, MULTI_THREAD } from "../../../../../src/experimental/features";
23-
import RxPlayer from "../../../../../src/minimal";
21+
} from "../../../../src/features/list";
22+
import { METAPLAYLIST, MULTI_THREAD } from "../../../../src/experimental/features";
23+
import RxPlayer from "../../../../src/minimal";
2424
import { linkPlayerEventsToState } from "./events";
2525
import VideoThumbnailLoader, {
2626
DASH_LOADER,
27-
} from "../../../../../src/experimental/tools/VideoThumbnailLoader";
27+
} from "../../../../src/experimental/tools/VideoThumbnailLoader";
2828
import CatchUpModeController from "./catchUp";
2929
import { declareModule } from "../../lib/declareModule";
3030
import type {
@@ -40,7 +40,7 @@ import type {
4040
ITextTrack,
4141
IVideoRepresentation,
4242
IVideoTrack,
43-
} from "../../../../../src/public_types";
43+
} from "../../../../src/public_types";
4444

4545
RxPlayer.addFeatures([
4646
DASH,

demo/standalone/index.html

Lines changed: 0 additions & 18 deletions
This file was deleted.
File renamed without changes.

demo/full/tsconfig.json renamed to demo/tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"types": [],
1616
"moduleResolution": "node",
1717
"jsx": "react",
18-
"typeRoots": ["../../node_modules/@types"],
18+
"typeRoots": ["../node_modules/@types"],
1919
},
20-
"include": ["../../src/globals.prod.d.ts", "./scripts/**/*"],
20+
"include": ["../src/globals.prod.d.ts", "./scripts/**/*"],
2121
}

package.json

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@
153153
"check": "npm run check:types && npm run lint && npm run check:types:unit_tests",
154154
"check:all": "npm run check:types && npm run lint && npm run lint:demo && npm run lint:tests && npm run test:unit && npm run test:integration && npm run test:memory && node -r esm ./scripts/check_nodejs_import_compatibility.js",
155155
"check:demo": "npm run check:demo:types && npm run lint:demo",
156-
"check:demo:types": "tsc --noEmit --project demo/full",
156+
"check:demo:types": "tsc --noEmit --project demo/",
157157
"clean:build": "rimraf dist",
158158
"check:types": "tsc --noEmit --project .",
159159
"check:types:unit_tests": "tsc --noEmit --project ./tsconfig.unit-tests.json",
@@ -168,12 +168,11 @@
168168
"fmt:rust": "cd ./src/parsers/manifest/dash/wasm-parser && cargo fmt",
169169
"fmt:rust:check": "cd ./src/parsers/manifest/dash/wasm-parser && cargo fmt --check",
170170
"lint": "eslint src -c .eslintrc.js",
171-
"lint:demo": "eslint -c demo/full/.eslintrc.js demo/full/scripts",
171+
"lint:demo": "eslint -c demo/.eslintrc.js demo/scripts",
172172
"lint:tests": "eslint tests/**/*.js --ignore-pattern '/tests/performance/bundle*'",
173173
"list": "node scripts/list-npm-scripts.mjs",
174174
"prepublishOnly": "npm run build:all",
175175
"releases:dev": "./scripts/make-dev-releases",
176-
"standalone": "node ./scripts/run_standalone_demo.mjs",
177176
"start": "node ./scripts/start_demo_web_server.mjs",
178177
"start:wasm": "node ./scripts/start_demo_web_server.mjs --include-wasm",
179178
"test:integration": "npm run test:integration:chrome && npm run test:integration:firefox",
@@ -226,16 +225,15 @@
226225
},
227226
"scripts-list": {
228227
"Build a demo page (e.g. to test a code change)": {
229-
"start": "Build the \"full\" demo (with a UI) with the non-minified RxPlayer and serve it on a local server. Re-build on file updates.",
230-
"start:wasm": "Build the \"full\" demo (with a UI) with the non-minified RxPlayer including the DASH WebAssembly MPD parser and serve it on a local server. Re-build on file updates.",
228+
"start": "Build the demo with the non-minified RxPlayer and serve it on a local server. Re-build on file updates.",
229+
"start:wasm": "Build the demo with the non-minified RxPlayer including the DASH WebAssembly MPD parser and serve it on a local server. Re-build on file updates.",
231230
"demo": "Build the demo in demo/bundle.js",
232231
"demo:min": "Build the demo and minify it in demo/bundle.js",
233232
"demo:watch": "Build the demo in demo/bundle.js each times the files update.",
234-
"check:demo": "Check the validity of the full demo directory by running the type checker and linter on it",
235-
"check:demo:types": "Check TypeScript types in full demo files",
236-
"lint:demo": "Run linter on the full demo files",
237-
"standalone": "Build and launch the \"standalone\" demo (without any UI) on a local server. Re-build on file updates.",
238-
"certificate": "Generate a certificate to be able to use HTTPS locally for the demo pages (`npm run start` and `npm run standalone` will then listen to HTTPS requests through a communicated port)"
233+
"check:demo": "Check the validity of the demo directory by running the type checker and linter on it",
234+
"check:demo:types": "Check TypeScript types in demo files",
235+
"lint:demo": "Run linter on demo files",
236+
"certificate": "Generate a certificate to be able to use HTTPS locally for the demo pages (`npm run start` will then listen to HTTPS requests through a communicated port)"
239237
},
240238
"Type-check, format, or lint the current code": {
241239
"check": "Check the validity of the src directory by running the type checker and linter on it",

scripts/build_demo.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ import getHumanReadableHours from "./utils/get_human_readable_hours.mjs";
1919
import runBundler from "./run_bundler.mjs";
2020

2121
const WORKER_IN_FILE = join(rootDirectory, "src/worker_entry_point.ts");
22-
const DEMO_OUT_FILE = join(rootDirectory, "demo/full/bundle.js");
23-
const WORKER_OUT_FILE = join(rootDirectory, "demo/full/worker.js");
22+
const DEMO_OUT_FILE = join(rootDirectory, "demo/bundle.js");
23+
const WORKER_OUT_FILE = join(rootDirectory, "demo/worker.js");
2424
const WASM_FILE_DEPENDENCY = join(rootDirectory, "dist/mpd-parser.wasm");
2525

2626
// If true, this script is called directly
@@ -112,7 +112,7 @@ export default function buildDemo(options) {
112112

113113
// Create a context for incremental builds
114114
esbuild[meth]({
115-
entryPoints: [join(rootDirectory, "demo/full/scripts/index.tsx")],
115+
entryPoints: [join(rootDirectory, "demo/scripts/index.tsx")],
116116
bundle: true,
117117
target: "es2017",
118118
minify,

0 commit comments

Comments
 (0)