From 0e33fd6a8a04111a5ce7893302ca017fa2819ef6 Mon Sep 17 00:00:00 2001 From: Mattias Buelens Date: Wed, 27 Mar 2024 17:08:56 +0100 Subject: [PATCH 01/16] Update GitHub Actions --- .github/workflows/main.yml | 8 ++++---- .github/workflows/npm-publish.yml | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 77b075a61..d7134ce62 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,11 +13,11 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - + - uses: actions/checkout@v4 + - name: Setup Node.js environment - uses: actions/setup-node@v3.4.1 - + uses: actions/setup-node@v4 + - name: Run npm run: npm ci diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index af7e6048d..22b1be949 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -11,8 +11,8 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 16 - run: npm ci @@ -21,8 +21,8 @@ jobs: needs: build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 16 registry-url: https://registry.npmjs.org/ From a23de394e99b85f9b6ecfe8c5e77c8cb761d9a39 Mon Sep 17 00:00:00 2001 From: Mattias Buelens Date: Wed, 27 Mar 2024 17:09:23 +0100 Subject: [PATCH 02/16] Use Node.js 20 --- .github/workflows/main.yml | 2 ++ .github/workflows/npm-publish.yml | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d7134ce62..3fbe9b7c8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,6 +17,8 @@ jobs: - name: Setup Node.js environment uses: actions/setup-node@v4 + with: + node-version: 20 - name: Run npm run: npm ci diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index 22b1be949..d24a5a6c1 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -14,7 +14,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version: 16 + node-version: 20 - run: npm ci publish-npm: @@ -24,7 +24,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version: 16 + node-version: 20 registry-url: https://registry.npmjs.org/ - run: npm ci - run: npm publish From d51117141a3b236a3a0485f53a073bb5605b618f Mon Sep 17 00:00:00 2001 From: Mattias Buelens Date: Wed, 27 Mar 2024 17:09:58 +0100 Subject: [PATCH 03/16] Reformat --- .github/workflows/main.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3fbe9b7c8..8ba9fce19 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,26 +2,21 @@ name: CI on: push: - branches: [ "develop", "master" ] + branches: ['develop', 'master'] pull_request: - branches: [ "develop", "master" ] - + branches: ['develop', 'master'] workflow_dispatch: jobs: lint: runs-on: ubuntu-latest - steps: - uses: actions/checkout@v4 - - name: Setup Node.js environment uses: actions/setup-node@v4 with: node-version: 20 - - name: Run npm run: npm ci - - name: Check lint run: npm run lint From af0307d6f7ec8b84e4336d170e4a84e4152365f2 Mon Sep 17 00:00:00 2001 From: Mattias Buelens Date: Wed, 27 Mar 2024 17:12:39 +0100 Subject: [PATCH 04/16] Remove useless "build" job for npm publish --- .github/workflows/npm-publish.yml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index d24a5a6c1..f60a63b78 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -8,17 +8,7 @@ on: types: [created] jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: 20 - - run: npm ci - publish-npm: - needs: build runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 From 5231859ee893170ff2606cbd4ccd79d360d36c07 Mon Sep 17 00:00:00 2001 From: Mattias Buelens Date: Wed, 27 Mar 2024 17:57:44 +0100 Subject: [PATCH 05/16] Set up TypeDoc --- .gitignore | 3 ++ package-lock.json | 100 ++++++++++++++++++++++++++++++++++++++++++++++ package.json | 6 ++- typedoc.config.js | 16 ++++++++ 4 files changed, 123 insertions(+), 2 deletions(-) create mode 100644 typedoc.config.js diff --git a/.gitignore b/.gitignore index 380d1f801..146d2eff7 100644 --- a/.gitignore +++ b/.gitignore @@ -70,3 +70,6 @@ ios/custom/Frameworks/**/*.zip ios/custom/Frameworks/integrations ios/build.sh ios/custom/Frameworks/tvos/*.xcframework + +# TypeDoc +api/ diff --git a/package-lock.json b/package-lock.json index 0f82ad3e3..a3ae83f7d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,6 +23,7 @@ "react-native": "^0.73.4", "react-native-builder-bob": "^0.23.2", "theoplayer": "^6.10.0", + "typedoc": "^0.25.12", "typescript": "5.0.4" }, "engines": { @@ -4644,6 +4645,12 @@ "node": ">=8" } }, + "node_modules/ansi-sequence-parser": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ansi-sequence-parser/-/ansi-sequence-parser-1.1.1.tgz", + "integrity": "sha512-vJXt3yiaUL4UU546s3rPXlsry/RnM730G1+HkpKE012AN0sx1eOrxSu95oKDIonskeLTijMgqWZ3uDEe3NFvyg==", + "dev": true + }, "node_modules/ansi-styles": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", @@ -8458,6 +8465,12 @@ "node": ">=6" } }, + "node_modules/jsonc-parser": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.1.tgz", + "integrity": "sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==", + "dev": true + }, "node_modules/jsonfile": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", @@ -8832,6 +8845,12 @@ "node": ">=10" } }, + "node_modules/lunr": { + "version": "2.3.9", + "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz", + "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==", + "dev": true + }, "node_modules/make-dir": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", @@ -8863,6 +8882,18 @@ "tmpl": "1.0.5" } }, + "node_modules/marked": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/marked/-/marked-4.3.0.tgz", + "integrity": "sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A==", + "dev": true, + "bin": { + "marked": "bin/marked.js" + }, + "engines": { + "node": ">= 12" + } + }, "node_modules/marky": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/marky/-/marky-1.2.5.tgz", @@ -11223,6 +11254,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/shiki": { + "version": "0.14.7", + "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.14.7.tgz", + "integrity": "sha512-dNPAPrxSc87ua2sKJ3H5dQ/6ZaY8RNnaAqK+t0eG7p0Soi2ydiqbGOTaZCqaYvA/uZYfS1LJnemt3Q+mSfcPCg==", + "dev": true, + "dependencies": { + "ansi-sequence-parser": "^1.1.0", + "jsonc-parser": "^3.2.0", + "vscode-oniguruma": "^1.7.0", + "vscode-textmate": "^8.0.0" + } + }, "node_modules/side-channel": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", @@ -11776,6 +11819,51 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/typedoc": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.25.12.tgz", + "integrity": "sha512-F+qhkK2VoTweDXd1c42GS/By2DvI2uDF4/EpG424dTexSHdtCH52C6IcAvMA6jR3DzAWZjHpUOW+E02kyPNUNw==", + "dev": true, + "dependencies": { + "lunr": "^2.3.9", + "marked": "^4.3.0", + "minimatch": "^9.0.3", + "shiki": "^0.14.7" + }, + "bin": { + "typedoc": "bin/typedoc" + }, + "engines": { + "node": ">= 16" + }, + "peerDependencies": { + "typescript": "4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x" + } + }, + "node_modules/typedoc/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/typedoc/node_modules/minimatch": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/typescript": { "version": "5.0.4", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz", @@ -11940,6 +12028,18 @@ "integrity": "sha512-gQpnTgkubC6hQgdIcRdYGDSDc+SaujOdyesZQMv6JlfQee/9Mp0Qhnys6WxDWvQnL5WZdT7o2Ul187aSt0Rq+w==", "dev": true }, + "node_modules/vscode-oniguruma": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/vscode-oniguruma/-/vscode-oniguruma-1.7.0.tgz", + "integrity": "sha512-L9WMGRfrjOhgHSdOYgCt/yRMsXzLDJSL7BPrOZt73gU0iWO4mpqzqQzOz5srxqTvMBaR0XZTSrVWo4j55Rc6cA==", + "dev": true + }, + "node_modules/vscode-textmate": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-8.0.0.tgz", + "integrity": "sha512-AFbieoL7a5LMqcnOF04ji+rpXadgOXnZsxQr//r83kLPr7biP7am3g9zbaZIaBGwBRWeSvoMD4mgPdX3e4NWBg==", + "dev": true + }, "node_modules/walker": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz", diff --git a/package.json b/package.json index b4849bb8c..613d64a32 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,8 @@ "lint": "eslint \"**/*.{ts,tsx}\"", "prepare": "bob build && husky install", "release": "release-it", - "pods": "cd example && pod-install --quiet" + "pods": "cd example && pod-install --quiet", + "docs": "typedoc --treatWarningsAsErrors" }, "keywords": [ "react-native", @@ -47,9 +48,9 @@ "registry": "https://registry.npmjs.org/" }, "devDependencies": { + "@react-native/eslint-config": "0.73.2", "@types/react": "^18.2.24", "@types/react-native": "^0.73.0", - "@react-native/eslint-config": "0.73.2", "eslint": "^8.56.0", "husky": "^6.0.0", "pod-install": "^0.1.39", @@ -58,6 +59,7 @@ "react-native": "^0.73.4", "react-native-builder-bob": "^0.23.2", "theoplayer": "^6.10.0", + "typedoc": "^0.25.12", "typescript": "5.0.4" }, "peerDependencies": { diff --git a/typedoc.config.js b/typedoc.config.js new file mode 100644 index 000000000..f4f511abe --- /dev/null +++ b/typedoc.config.js @@ -0,0 +1,16 @@ +/** @type {import('typedoc').TypeDocOptions} */ +module.exports = { + entryPoints: ['src/index.tsx'], + tsconfig: 'tsconfig.build.json', + out: 'api', + sitemapBaseUrl: 'https://theoplayer.github.io/react-native-theoplayer/api/', + name: 'React Native THEOplayer', + readme: 'none', + navigationLinks: { + Docs: 'https://www.theoplayer.com/docs/', + 'THEOplayer.com': 'https://www.theoplayer.com/', + }, + githubPages: true, + excludePrivate: true, + excludeExternals: true, +}; From 415f206401b092f979733183d63aeaef85369475 Mon Sep 17 00:00:00 2001 From: Mattias Buelens Date: Wed, 27 Mar 2024 17:58:54 +0100 Subject: [PATCH 06/16] Fix missing } --- src/api/media/MediaControlConfiguration.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/media/MediaControlConfiguration.ts b/src/api/media/MediaControlConfiguration.ts index 68b2599cd..8f02d5be0 100644 --- a/src/api/media/MediaControlConfiguration.ts +++ b/src/api/media/MediaControlConfiguration.ts @@ -3,7 +3,7 @@ * * For Android, this applies to the {@link https://developer.android.com/guide/topics/media-apps/working-with-a-media-session Media Session} * functionality, providing the platform with a uniform way of interacting with the player, and the - * {@link https://developer.android.com/develop/ui/views/notifications Notification to display information on the media currently playing. + * {@link https://developer.android.com/develop/ui/views/notifications Notification} to display information on the media currently playing. * * For Web, this applies to the {@link https://www.w3.org/TR/mediasession/ Media Session} API for customizing media notifications and access to * platform media keys. From ee9126635e90de04d68d613595468d1a0159f3fd Mon Sep 17 00:00:00 2001 From: Mattias Buelens Date: Wed, 27 Mar 2024 18:05:25 +0100 Subject: [PATCH 07/16] Fix barrel files --- src/api/barrel.ts | 1 + src/api/cache/barrel.ts | 1 + src/api/event/barrel.ts | 4 +++- src/api/utils/barrel.ts | 1 + 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/api/barrel.ts b/src/api/barrel.ts index cf27be114..b41fb6808 100644 --- a/src/api/barrel.ts +++ b/src/api/barrel.ts @@ -13,6 +13,7 @@ export * from './drm/barrel'; export * from './source/barrel'; export * from './timeranges/barrel'; export * from './track/barrel'; +export * from './ui/barrel'; export * from './utils/barrel'; export * from './THEOplayerView'; export * from './player/barrel'; diff --git a/src/api/cache/barrel.ts b/src/api/cache/barrel.ts index 81b9b0f67..1d52a7db1 100644 --- a/src/api/cache/barrel.ts +++ b/src/api/cache/barrel.ts @@ -2,6 +2,7 @@ export * from './CachingTask'; export * from './CachingTaskLicense'; export * from './CachingTaskList'; export * from './CachingTaskParameters'; +export * from './CachingPreferredTrackSelection'; export * from './MediaCacheAPI'; export * from './events/barrel'; export * from './hooks/barrel'; diff --git a/src/api/event/barrel.ts b/src/api/event/barrel.ts index 91f1777fb..5319d96f4 100644 --- a/src/api/event/barrel.ts +++ b/src/api/event/barrel.ts @@ -1,5 +1,7 @@ +export * from './Event'; +export * from './EventListener'; +export * from './EventDispatcher'; export * from './AdEvent'; export * from './CastEvent'; export * from './PlayerEvent'; export * from './TrackEvent'; -export * from './Event'; diff --git a/src/api/utils/barrel.ts b/src/api/utils/barrel.ts index 0c533190b..4f1ac291f 100644 --- a/src/api/utils/barrel.ts +++ b/src/api/utils/barrel.ts @@ -1 +1,2 @@ +export * from './RetryConfiguration'; export * from './TypeUtils'; From cbf83b402eb7421738d7e351d75228dfc570a4cc Mon Sep 17 00:00:00 2001 From: Mattias Buelens Date: Wed, 27 Mar 2024 18:05:47 +0100 Subject: [PATCH 08/16] Fix exported types --- src/internal/cache/MediaCache.ts | 12 ++++++------ src/internal/drm/ContentProtectionRegistry.ts | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/internal/cache/MediaCache.ts b/src/internal/cache/MediaCache.ts index ff41208e1..f38548d8d 100644 --- a/src/internal/cache/MediaCache.ts +++ b/src/internal/cache/MediaCache.ts @@ -9,9 +9,9 @@ import type { CachingTaskParameters } from '../../api/cache/CachingTaskParameter import type { CachingTask } from '../../api/cache/CachingTask'; import { NativeEventEmitter, NativeModules } from 'react-native'; import { NativeCachingTask, NativeCachingTaskAdapter } from './NativeCachingTaskAdapter'; -import { toNativeCachingTaskParameters } from "./NativeCachingTaskParametersAdapter"; +import { toNativeCachingTaskParameters } from './NativeCachingTaskParametersAdapter'; -const TAG = "NativeMediaCache"; +const TAG = 'NativeMediaCache'; const NativeCacheModule = NativeModules.THEORCTCacheModule; @@ -95,12 +95,12 @@ export class NativeMediaCache extends DefaultEventDispatcher impl this._status = event.status; this.dispatchEvent({ type: CacheEventType.statechange, - date: new Date() + date: new Date(), }); }; private onAddCachingTaskEvent = (event: NativeAddCachingTaskEvent) => { - const task= new NativeCachingTaskAdapter(event.task); + const task = new NativeCachingTaskAdapter(event.task); this._tasks.push(task); this.dispatchEvent({ type: CacheEventType.addtask, @@ -119,7 +119,7 @@ export class NativeMediaCache extends DefaultEventDispatcher impl date: new Date(), }); } else { - console.warn(TAG, `onRemoveCachingTaskEvent: CachingTask with id ${event.task.id} not found.`) + console.warn(TAG, `onRemoveCachingTaskEvent: CachingTask with id ${event.task.id} not found.`); } }; @@ -150,4 +150,4 @@ export class NativeMediaCache extends DefaultEventDispatcher impl } } -export const MediaCache = new NativeMediaCache(); +export const MediaCache: MediaCacheAPI = new NativeMediaCache(); diff --git a/src/internal/drm/ContentProtectionRegistry.ts b/src/internal/drm/ContentProtectionRegistry.ts index f734d6225..65158a3d7 100644 --- a/src/internal/drm/ContentProtectionRegistry.ts +++ b/src/internal/drm/ContentProtectionRegistry.ts @@ -172,4 +172,4 @@ export class NativeContentProtectionRegistry implements ContentProtectionAPI { }; } -export const ContentProtectionRegistry = new NativeContentProtectionRegistry(); +export const ContentProtectionRegistry: ContentProtectionAPI = new NativeContentProtectionRegistry(); From dbc2d59a5ca45dd4438e1f234793179be4e9f41a Mon Sep 17 00:00:00 2001 From: Mattias Buelens Date: Wed, 27 Mar 2024 18:14:01 +0100 Subject: [PATCH 09/16] Set up resolver for THEOplayer API docs --- package-lock.json | 21 +++++++++++++++++++++ package.json | 2 ++ typedoc.config.js | 7 +++++++ 3 files changed, 30 insertions(+) diff --git a/package-lock.json b/package-lock.json index a3ae83f7d..9c707bbb9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,6 +24,8 @@ "react-native-builder-bob": "^0.23.2", "theoplayer": "^6.10.0", "typedoc": "^0.25.12", + "typedoc-plugin-external-resolver": "^1.0.3", + "typedoc-plugin-mdn-links": "^3.1.18", "typescript": "5.0.4" }, "engines": { @@ -11840,6 +11842,25 @@ "typescript": "4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x" } }, + "node_modules/typedoc-plugin-external-resolver": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/typedoc-plugin-external-resolver/-/typedoc-plugin-external-resolver-1.0.3.tgz", + "integrity": "sha512-P73ZjN8fX3xQ2KpggrxhPIBg3ZyljhylHl69+lC0QRnyt4j9ijXFrorKjPPOU0Z63cm0Annd89Aejf4SMNo3kA==", + "dev": true, + "peerDependencies": { + "typedoc": "0.25.x", + "typescript": "4.x || 5.x" + } + }, + "node_modules/typedoc-plugin-mdn-links": { + "version": "3.1.18", + "resolved": "https://registry.npmjs.org/typedoc-plugin-mdn-links/-/typedoc-plugin-mdn-links-3.1.18.tgz", + "integrity": "sha512-BGzSUEHT15o3g2Q1q/5tBQufAM+yqJNwU1aUmYZC9qbfCS1I5qyEkmoxZ9ks2Z3TwPTZ8PMfIKd2vq5/0nmLnw==", + "dev": true, + "peerDependencies": { + "typedoc": ">= 0.23.14 || 0.24.x || 0.25.x" + } + }, "node_modules/typedoc/node_modules/brace-expansion": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", diff --git a/package.json b/package.json index 613d64a32..31a320c73 100644 --- a/package.json +++ b/package.json @@ -60,6 +60,8 @@ "react-native-builder-bob": "^0.23.2", "theoplayer": "^6.10.0", "typedoc": "^0.25.12", + "typedoc-plugin-external-resolver": "^1.0.3", + "typedoc-plugin-mdn-links": "^3.1.18", "typescript": "5.0.4" }, "peerDependencies": { diff --git a/typedoc.config.js b/typedoc.config.js index f4f511abe..3c331a49c 100644 --- a/typedoc.config.js +++ b/typedoc.config.js @@ -6,6 +6,7 @@ module.exports = { sitemapBaseUrl: 'https://theoplayer.github.io/react-native-theoplayer/api/', name: 'React Native THEOplayer', readme: 'none', + plugin: ['typedoc-plugin-external-resolver', 'typedoc-plugin-mdn-links'], navigationLinks: { Docs: 'https://www.theoplayer.com/docs/', 'THEOplayer.com': 'https://www.theoplayer.com/', @@ -13,4 +14,10 @@ module.exports = { githubPages: true, excludePrivate: true, excludeExternals: true, + externalDocumentation: { + theoplayer: { + dtsPath: '~/THEOplayer.d.ts', + externalBaseURL: 'https://www.theoplayer.com/docs/theoplayer/v6/api-reference/web', + }, + }, }; From f38e8604c4ed7cdb69384be6159466f11eabb7d0 Mon Sep 17 00:00:00 2001 From: Mattias Buelens Date: Wed, 27 Mar 2024 18:14:36 +0100 Subject: [PATCH 10/16] Fix links to THEOplayer API --- src/api/cache/events/CacheEvent.ts | 4 ++-- src/api/config/PlayerConfiguration.ts | 2 +- src/api/source/SourceDescription.ts | 8 ++++---- src/api/track/TextTrackCue.ts | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/api/cache/events/CacheEvent.ts b/src/api/cache/events/CacheEvent.ts index 02644c421..2c2c37a9d 100644 --- a/src/api/cache/events/CacheEvent.ts +++ b/src/api/cache/events/CacheEvent.ts @@ -9,13 +9,13 @@ export enum CacheEventType { } /** - * The events dispatched by the {@link Cache | cache API}. + * The events dispatched by the {@link MediaCacheAPI | cache API}. * * @public */ export interface CacheEventMap { /** - * Dispatched when {@link Cache.status} changes. + * Dispatched when {@link MediaCacheAPI.status} changes. */ [CacheEventType.statechange]: Event; diff --git a/src/api/config/PlayerConfiguration.ts b/src/api/config/PlayerConfiguration.ts index 86fdc2250..4d70204bc 100644 --- a/src/api/config/PlayerConfiguration.ts +++ b/src/api/config/PlayerConfiguration.ts @@ -21,7 +21,7 @@ export interface PlayerConfiguration { * The muted autoplay policy for web. * * @remarks - *
- The muted autoplay policy is impacted by this property and {@link SourceConfiguration.mutedAutoplay}. + *
- The muted autoplay policy is impacted by this property and {@link theoplayer!SourceConfiguration.mutedAutoplay}. * * @defaultValue `'none'`. */ diff --git a/src/api/source/SourceDescription.ts b/src/api/source/SourceDescription.ts index 3e99ac621..d126b106a 100644 --- a/src/api/source/SourceDescription.ts +++ b/src/api/source/SourceDescription.ts @@ -60,7 +60,7 @@ export interface SourceConfiguration { * * @remarks *
- An empty string (`''`) clears the current poster. - *
- This poster has priority over {@link ChromelessPlayer.poster}. + *
- This poster has priority over {@link theoplayer!ChromelessPlayer.poster}. */ poster?: string; @@ -226,7 +226,7 @@ export interface TextTrackDescription { * The PTS value used to sync the track with the video. * * @internal - * + * * @remarks *
- Available on iOS. */ @@ -237,8 +237,8 @@ export interface TextTrackDescription { * * @internal * @remarks - *
- Available on iOS. - *
- Format: "HH:mm:mm:SSS" + *
- Available on iOS. + *
- Format: "HH:mm:mm:SSS" *
- Default value is "00:00:00:000" */ subtitleLocaltime?: string; diff --git a/src/api/track/TextTrackCue.ts b/src/api/track/TextTrackCue.ts index 021f0493d..549154e6a 100644 --- a/src/api/track/TextTrackCue.ts +++ b/src/api/track/TextTrackCue.ts @@ -32,7 +32,7 @@ export interface TextTrackCue { * The content of the cue. * * @remarks - * The content differs depending on the {@link TextTrackCue.track}'s {@link TextTrack."type" | type }: + * The content differs depending on the {@link theoplayer!TextTrackCue.track}'s {@link TextTrack."type" | type }: *
- `'emsg'`: Content is a Uint8Array representing the binary message data from the `emsg` box. *
- `'eventstream'`: Content is the value of the `messageData` attribute which was specified in the manifest. *
- `'ttml'`: Content is an intermediate TTML document’s body element. This is a view of a TTML document where all nodes in the document are active during the cue’s startTime and endTime. As a result, all begin, dur and end properties have been removed. TTML Styles, Regions and Metadata are stored in cue.styles, cue.regions, cue.metadata respectively. Combining those properties with the given content should suffice to render a TTML cue. From 81e7fae94661b629d6cf1a0e93559226353ab227 Mon Sep 17 00:00:00 2001 From: Mattias Buelens Date: Wed, 27 Mar 2024 19:07:41 +0100 Subject: [PATCH 11/16] Fix compatibility with Jekyll --- doc/creating-minimal-app.md | 5 ++++- doc/fullscreen.md | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/doc/creating-minimal-app.md b/doc/creating-minimal-app.md index 81b4674e2..e3b9249b3 100644 --- a/doc/creating-minimal-app.md +++ b/doc/creating-minimal-app.md @@ -53,6 +53,7 @@ $ npm i react-native-theoplayer --legacy-peer-deps Finally, replace the `App.tsx` with this minimal code: +{% raw %} ```tsx import React from 'react'; import {Platform, View} from 'react-native'; @@ -87,6 +88,7 @@ const App = () => { export default App; ``` +{% endraw %} When configuring a stream that is hosted on another server than `cdn.theoplayer.com`, a license for the React Native SDK needs to be obtained through the 'Licenses' built in the [THEOplayer portal](https://portal.theoplayer.com/) @@ -143,7 +145,8 @@ To define which extra THEOplayer integrations need to be loaded for additional f Create a json file **[YourApplicationFolder]/react-native-theoplayer.json**, or **[YourApplicationFolder]/theoplayer-config.json**, on the same level as the node_modules folder (both alternatives offer the same functionality). -Edit the file to reflect the features required for your application. The following example adds Google IMA, Chromecast and Sideloaded textTracks to the setup. If one of these is out of your applications scope, you can leave it out to reduce the app's size. When using only basic functionality, leave the features array empty. +Edit the file to reflect the features required for your application. The following example adds Google IMA, Chromecast and Sideloaded textTracks to the setup. If one of these is out of your applications scope, you can leave it out to reduce the app's size. When using only basic functionality, leave the features array empty. + Example: ``` { diff --git a/doc/fullscreen.md b/doc/fullscreen.md index b4529c814..1b033e4b1 100644 --- a/doc/fullscreen.md +++ b/doc/fullscreen.md @@ -89,6 +89,7 @@ use [a package](https://www.npmjs.com/package/@alexzunik/rn-native-portals-rebor _relocates the native view to a different parent in the native view hierarchy_. This approach aims to prevent the remounting of the complex video component. +{% raw %} ```tsx export default function App() { const [isMiniPlayer, setMiniPlayer] = useState(false); @@ -117,6 +118,7 @@ export default function App() { ); } ``` +{% endraw %} The player component along with its UI container in the example above is wrapped in a `PortalOrigin`. Its destination is left `null` as long as the player is presented inline. From 81120bcdfb673c05ff90ef91767871c224c5c20f Mon Sep 17 00:00:00 2001 From: Mattias Buelens Date: Wed, 27 Mar 2024 19:10:59 +0100 Subject: [PATCH 12/16] Set up Jekyll --- .gitignore | 4 ++++ Gemfile | 36 ++++++++++++++++++++++++++++++++++++ _config.yml | 23 +++++++++++++++++++++++ 3 files changed, 63 insertions(+) create mode 100644 Gemfile create mode 100644 _config.yml diff --git a/.gitignore b/.gitignore index 146d2eff7..80123bbae 100644 --- a/.gitignore +++ b/.gitignore @@ -73,3 +73,7 @@ ios/custom/Frameworks/tvos/*.xcframework # TypeDoc api/ + +# Jekyll / GitHub Pages +_site/ +Gemfile.lock diff --git a/Gemfile b/Gemfile new file mode 100644 index 000000000..cf77857df --- /dev/null +++ b/Gemfile @@ -0,0 +1,36 @@ +source "https://rubygems.org" +# Hello! This is where you manage which Jekyll version is used to run. +# When you want to use a different version, change it below, save the +# file and run `bundle install`. Run Jekyll with `bundle exec`, like so: +# +# bundle exec jekyll serve +# +# This will help ensure the proper Jekyll version is running. +# Happy Jekylling! +# gem "jekyll", "~> 4.3.2" +# This is the default theme for new Jekyll sites. You may change this to anything you like. +# gem "minima", "~> 2.5" +# If you want to use GitHub Pages, remove the "gem "jekyll"" above and +# uncomment the line below. To upgrade, run `bundle update github-pages`. +gem "github-pages", group: :jekyll_plugins +# If you have any plugins, put them here! +group :jekyll_plugins do +# gem "jekyll-feed", "~> 0.12" +end + +# Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem +# and associated library. +platforms :mingw, :x64_mingw, :mswin, :jruby do + gem "tzinfo", ">= 1", "< 3" + gem "tzinfo-data" +end + +# Performance-booster for watching directories on Windows +gem "wdm", "~> 0.1.1", :install_if => Gem.win_platform? + +# Lock `http_parser.rb` gem to `v0.6.x` on JRuby builds since newer versions of the gem +# do not have a Java counterpart. +gem "http_parser.rb", "~> 0.6.0", :platforms => [:jruby] + +# Needed for `jekyll serve` +gem "webrick", "~> 1.8" diff --git a/_config.yml b/_config.yml new file mode 100644 index 000000000..7a6108cef --- /dev/null +++ b/_config.yml @@ -0,0 +1,23 @@ +title: React Native THEOplayer +description: >- + A React Native THEOplayerView component +author: THEO Technologies +remote_theme: pages-themes/primer@v0.6.0 +plugins: + - jekyll-remote-theme +include: + - api/ +exclude: + - LICENSE + - '.*.js' + - '*.json' + - '*.plugin.js' + - '*.config.js' + - '*.podspec' + - '.*/' + - android/ + - example/ + - ios/ + - lib/ + - node_modules/ + - src/ From 780d14fdcb52c84dc6f4452d2af3dfb059c782e7 Mon Sep 17 00:00:00 2001 From: Mattias Buelens Date: Wed, 27 Mar 2024 19:11:15 +0100 Subject: [PATCH 13/16] Deploy to GitHub Pages with workflow --- .github/workflows/pages.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/pages.yml diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml new file mode 100644 index 000000000..f56d1b88d --- /dev/null +++ b/.github/workflows/pages.yml @@ -0,0 +1,35 @@ +name: GitHub Pages + +on: + push: + branches: + - develop + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Pages + uses: actions/configure-pages@v4 + - name: Build + uses: actions/jekyll-build-pages@v1 + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + deploy: + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v2 + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} From 84fd2282bd36a6e2f1f83d23a310bf0af77904c0 Mon Sep 17 00:00:00 2001 From: Mattias Buelens Date: Wed, 27 Mar 2024 19:16:01 +0100 Subject: [PATCH 14/16] Build API docs in workflow --- .github/workflows/pages.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index f56d1b88d..dfaa0b0b8 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -19,7 +19,15 @@ jobs: uses: actions/checkout@v4 - name: Setup Pages uses: actions/configure-pages@v4 - - name: Build + - name: Setup Node.js environment + uses: actions/setup-node@v4 + with: + node-version: 20 + - name: Run npm + run: npm ci + - name: Build API docs + run: npm run docs + - name: Build website uses: actions/jekyll-build-pages@v1 - name: Upload artifact uses: actions/upload-pages-artifact@v3 From c643272a435c37616825851a954792a299d39145 Mon Sep 17 00:00:00 2001 From: Mattias Buelens Date: Wed, 27 Mar 2024 19:19:17 +0100 Subject: [PATCH 15/16] Fix footer link --- _config.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/_config.yml b/_config.yml index 7a6108cef..ebf267430 100644 --- a/_config.yml +++ b/_config.yml @@ -5,6 +5,10 @@ author: THEO Technologies remote_theme: pages-themes/primer@v0.6.0 plugins: - jekyll-remote-theme +github: + source: + branch: "develop" + path: "/" include: - api/ exclude: From 1eb2bc71e843ef7048167ef597c5bb4ae06bdcb0 Mon Sep 17 00:00:00 2001 From: Mattias Buelens Date: Wed, 27 Mar 2024 19:31:30 +0100 Subject: [PATCH 16/16] Fix bad rendering --- doc/migrating_v2.md | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/doc/migrating_v2.md b/doc/migrating_v2.md index 6dbfbe68a..20b24d9d6 100644 --- a/doc/migrating_v2.md +++ b/doc/migrating_v2.md @@ -20,11 +20,10 @@ such as `player.autoplay = true` and `player.pause()`. - - -
v1.x>= v2.x
-``` tsx +```tsx const App = () => { return ( @@ -40,7 +39,7 @@ const App = () => { -``` tsx +```tsx const onPlayerReady = (player: THEOplayer) => { player.autoplay = true; player.source = source; @@ -58,9 +57,7 @@ const App = () => { ```
### Listening to Player Events @@ -70,11 +67,10 @@ by a subscription approach. - - -
v1.x>= v2.x
-``` tsx +```tsx const App = () => { const [error, setError] = useState(); const [textTracks, setTextTracks] = useState([]); @@ -104,7 +100,7 @@ const App = () => { -``` tsx +```tsx const App = () => { const theoPlayer = useRef(); const [error, setError] = useState(); @@ -132,9 +128,7 @@ const App = () => { ```
### AdsAPI and CastAPI @@ -144,11 +138,10 @@ from the view's reference, it can now be requested directly from the player inst - - -
v1.x>= v2.x
-``` tsx +```tsx { this.player = ref; @@ -165,7 +158,7 @@ const isPlayingAd = () => { -``` tsx +```tsx { ```