diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 77b075a61..8ba9fce19 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,24 +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@v3 - + - uses: actions/checkout@v4 - name: Setup Node.js environment - uses: actions/setup-node@v3.4.1 - + uses: actions/setup-node@v4 + with: + node-version: 20 - name: Run npm run: npm ci - - name: Check lint run: npm run lint diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index af7e6048d..f60a63b78 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -8,23 +8,13 @@ on: types: [created] jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: 16 - - run: npm ci - publish-npm: - 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 + node-version: 20 registry-url: https://registry.npmjs.org/ - run: npm ci - run: npm publish diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml new file mode 100644 index 000000000..dfaa0b0b8 --- /dev/null +++ b/.github/workflows/pages.yml @@ -0,0 +1,43 @@ +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: 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 + 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 }} diff --git a/.gitignore b/.gitignore index 380d1f801..80123bbae 100644 --- a/.gitignore +++ b/.gitignore @@ -70,3 +70,10 @@ ios/custom/Frameworks/**/*.zip ios/custom/Frameworks/integrations ios/build.sh 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..ebf267430 --- /dev/null +++ b/_config.yml @@ -0,0 +1,27 @@ +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 +github: + source: + branch: "develop" + path: "/" +include: + - api/ +exclude: + - LICENSE + - '.*.js' + - '*.json' + - '*.plugin.js' + - '*.config.js' + - '*.podspec' + - '.*/' + - android/ + - example/ + - ios/ + - lib/ + - node_modules/ + - src/ 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. 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 { ```
diff --git a/package-lock.json b/package-lock.json index 0f82ad3e3..9c707bbb9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,6 +23,9 @@ "react-native": "^0.73.4", "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": { @@ -4644,6 +4647,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 +8467,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 +8847,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 +8884,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 +11256,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 +11821,70 @@ "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-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", + "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 +12049,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..31a320c73 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,9 @@ "react-native": "^0.73.4", "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/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/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/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/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. 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. 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'; 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(); diff --git a/typedoc.config.js b/typedoc.config.js new file mode 100644 index 000000000..3c331a49c --- /dev/null +++ b/typedoc.config.js @@ -0,0 +1,23 @@ +/** @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', + plugin: ['typedoc-plugin-external-resolver', 'typedoc-plugin-mdn-links'], + navigationLinks: { + Docs: 'https://www.theoplayer.com/docs/', + 'THEOplayer.com': 'https://www.theoplayer.com/', + }, + githubPages: true, + excludePrivate: true, + excludeExternals: true, + externalDocumentation: { + theoplayer: { + dtsPath: '~/THEOplayer.d.ts', + externalBaseURL: 'https://www.theoplayer.com/docs/theoplayer/v6/api-reference/web', + }, + }, +};