diff --git a/theoplayer/examples/_components/DrmDemo.tsx b/theoplayer/examples/_components/DrmDemo.tsx index 0ef287f41755..c3d86621b30c 100644 --- a/theoplayer/examples/_components/DrmDemo.tsx +++ b/theoplayer/examples/_components/DrmDemo.tsx @@ -6,7 +6,7 @@ import styles from '../shared.module.css'; type SourceName = 'drm' | 'aes'; const sourceLabels: Record = { - drm: 'DRM: Widevine or PlayReady (DASH), FairPlay (HLS)', + drm: 'DRM: Widevine, PlayReady or FairPlay (HLS)', aes: 'AES-128 (HLS)', }; @@ -18,8 +18,7 @@ const keySystems: Record = { function describeSource(src: string | undefined): string { if (!src) return '-'; - if (src.includes('dash-wv-pr')) return 'DASH with Widevine or PlayReady'; - if (src.includes('hls-fp')) return 'HLS with FairPlay'; + if (src.includes('protected_1080p_h264_cbcs')) return 'HLS with Widevine, PlayReady or FairPlay'; if (src.includes('encrypted')) return 'HLS with AES-128'; return src; } diff --git a/theoplayer/examples/_components/FeatureModulesDemo.tsx b/theoplayer/examples/_components/FeatureModulesDemo.tsx new file mode 100644 index 000000000000..9526bf238c8e --- /dev/null +++ b/theoplayer/examples/_components/FeatureModulesDemo.tsx @@ -0,0 +1,49 @@ +import React, { type JSX, useState } from 'react'; +import useBaseUrl from '@docusaurus/useBaseUrl'; +import Example from '@site/src/components/Example'; +import styles from '../shared.module.css'; + +interface FeatureModulesState { + modules: string[]; + features: string[]; + version: string; +} + +export default function FeatureModulesDemo(): JSX.Element { + const [state, setState] = useState(undefined); + + return ( + <> + { + if (message.type === 'feature-modules') { + setState({ + modules: message.modules as string[], + features: message.features as string[], + version: message.version as string, + }); + } + }} + /> +
+ + + + + + + + + + + + + + + +
Imported modules{state ? state.modules.join(', ') : '…'}
THEOplayer.features{state ? JSON.stringify(state.features) : '…'}
THEOplayer.version{state ? state.version : '…'}
+
+ + ); +} diff --git a/theoplayer/examples/content-protection/01-drm.mdx b/theoplayer/examples/content-protection/01-drm.mdx index 75795fc07fe4..c7d202e19cae 100644 --- a/theoplayer/examples/content-protection/01-drm.mdx +++ b/theoplayer/examples/content-protection/01-drm.mdx @@ -13,12 +13,12 @@ import DrmDemo from '../_components/DrmDemo'; This example plays protected content: -- **DRM**: a single source description with a DASH stream protected with Widevine and PlayReady, and an HLS stream protected with FairPlay. - The player picks the first stream that the current browser supports: Widevine or PlayReady in most browsers, and FairPlay in Safari. - The license requests are handled by the KeyOS [DRM integration](../../how-to-guides/web/drm/buydrm-keyos.mdx). +- **DRM**: an HLS stream protected with Widevine, PlayReady and FairPlay. + The player uses the key system that the current browser supports: Widevine or PlayReady in most browsers, and FairPlay in Safari. + The license requests are handled by the Axinom [DRM integration](../../how-to-guides/web/drm/axinom.mdx). - **AES-128**: an HLS stream encrypted with AES-128. The player fetches the decryption key from the URL in the HLS playlist, so no extra configuration is needed. -The box below the player shows which stream the player selected, and which DRM key systems your browser supports. +The box below the player shows which stream the player is playing, and which DRM key systems your browser supports.
Code diff --git a/theoplayer/examples/getting-started/02-feature-modules.mdx b/theoplayer/examples/getting-started/02-feature-modules.mdx new file mode 100644 index 000000000000..e2802966547c --- /dev/null +++ b/theoplayer/examples/getting-started/02-feature-modules.mdx @@ -0,0 +1,37 @@ +--- +sidebar_custom_props: { icon: '🧩' } +description: Import only the player features your app needs with feature modules, and check which features are enabled. +--- + +# Feature modules + +import CodeBlock from '@theme/CodeBlock'; +import demoSource from '!!raw-loader!../../static/theoplayer/v11/examples/feature-modules/demo.html'; +import FeatureModulesDemo from '../_components/FeatureModulesDemo'; + + + +Since version 11.16.0, the Web SDK ships every feature as a separate module. +This example imports the player without any features from `theoplayer/core`, and adds HLS playback with `theoplayer/hls`: + +```js +import * as THEOplayer from 'theoplayer/core'; +import 'theoplayer/hls'; +import '@theoplayer/web-ui'; +``` + +`THEOplayer.features` lists the features that are enabled, so the box below the player only shows `hls`. +Import every feature module before the player is created. + +This example loads the packages from a CDN with an [import map](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/script/type/importmap). +Open Video UI imports the player from `theoplayer/chromeless`, so the import map points that name to `theoplayer/core` as well. +In your application, install `theoplayer` and `@theoplayer/web-ui` from npm and bundle them instead. + +See [How to use THEOplayer feature modules](../../getting-started/01-sdks/01-web/14-how-to-use-feature-modules.md) for all available modules. + +
+ Code + + {demoSource} + +
diff --git a/theoplayer/static/theoplayer/v11/examples/conviva/demo.html b/theoplayer/static/theoplayer/v11/examples/conviva/demo.html index 58681c643594..a525d36d8004 100644 --- a/theoplayer/static/theoplayer/v11/examples/conviva/demo.html +++ b/theoplayer/static/theoplayer/v11/examples/conviva/demo.html @@ -33,7 +33,7 @@ - + + + + + + + + + + diff --git a/theoplayer/static/theoplayer/v11/examples/yospace/demo.html b/theoplayer/static/theoplayer/v11/examples/yospace/demo.html index 31ab6c90f93e..7220d212df52 100644 --- a/theoplayer/static/theoplayer/v11/examples/yospace/demo.html +++ b/theoplayer/static/theoplayer/v11/examples/yospace/demo.html @@ -39,7 +39,7 @@ - +