- Add option to disable focus-based keyboard interactivity.
- Add option to keep player controls hidden.
- Make
BaseThemeOverlay
more configurable:- Add option to hide buttons (audio, full screen, track options).
- Add option to hide the top bar of player controls.
- Add option to render a companion component above the bottom bar of player controls.
- Add option to display cues on the seek bar.
- Fix rounding of duration.
- Fix UI interaction on mobile platforms.
- Show UI controls on mouse move.
- Add basic keyboard shortcuts (Fast-forward, Rewind, Pause/Play).
- Fix styling of video canvas.
- Make sure the default entry point is ESM (this helps prevent Webpack issue 4674).
- Removed
showWhenDisabled
props fromPlayerControls
, it is no longer meaningful after the recent changes to controls visibility. Now controls are always visible when video is paused or idle. - Removed the
player
prop from all components (exceptPlayerSurface
). Instead of it, all components should be descendants ofPlayerSurface
and this way they get access to theplayer
instance from its context.To access the values from the context directly use<PlayerSurface player={player}> <BaseThemeOverlay/> </PlayerSurface>
PrestoContext
.import { PrestoContext } from "@castlabs/prestoplay-react-components" // descendant of PlayerSurface const UiComponent = () => { const { player, presto } = useContext(PrestoContext) }
- Changes to hooks:
- Hooks
usePrestoCoreEvent
,usePrestoUiEvent
no longer accept theplayer
argument, instead they should be wrapped withPlayerSurface
(orPrestoContext
). - Removed the
usePresto
. You can usePrestoContext
instead to access the PRESTOplay instance.import { PrestoContext } from "@castlabs/prestoplay-react-components" const useMyHook = () => { const { presto } = useContext(PrestoContext) }
- Removed the
useGlobalHide
hook. - Hooks
usePrestoEnabledState
,usePrestoEnabledStateClass
should be wrapped withPlayerSurface
(orPrestoContext
), in which case it is not necessary to pass theplayer
argument anymore.
- Hooks
HoverContainer
no longer accepts propslistenToHover
andnotTrackFullWidth
.
- VU Meter component.
- Fixes to
BaseThemeOverlay
:- Before start of playback make sure
CurrentTime
displays a valid value of0:00
. - Make sure seek bar is visible.
- Improve responsiveness of the UI.
- Before start of playback make sure
- Improve positioning by
HoverContainer
. - All components now accept
style
andclassName
prop and apply them to their top-most element. - Removed
children
prop from components that do not render any child components. - Fix
Duration
to display the correct value even when it is rendered after the video has been loaded.
- Player controls auto-hide after 3s instead of 5s.
- Added
mode
prop toPlayerControls
which can be used to configure the visibility of player controls.
-
Moved hooks
usePrestoCoreEvent
,usePrestoUiEvent
,usePresto
to a different subfolder. This will only affect you if you are using subfolder imports.// Instead if this import import { usePrestoCoreEvent, usePrestoUiEven, usePresto } from '@castlabs/prestoplay-react-components/Player'; // Use this import: import { usePrestoCoreEvent, usePrestoUiEvent, usePresto } from '@castlabs/prestoplay-react-components/react';
-
Removed
usePrestoEvent
hook. It has been renamed tousePrestoCoreEvent
. Note, that the use of the more high-level hookusePrestoUiEvent
is preferred whenever possible overusePrestoCoreEvent
. -
Removed
Player.on/off/one()
methods. UseusePrestoCoreEvent
hook to listen toPlayer
events instead. Alternatively, for you can use:const prestoPlayer = await Player.presto() prestoPlayer.on('event', () => {}) prestoPlayer.off('event')
-
Removed
Player.use()
method. Use the initializer callback passed to the constructor instead.e.g.:
new Player((pp:any) => { pp.use(clpp.dash.DashComponent); pp.use(clpp.hls.HlsComponent); })
-
Removed
StartButton.config
props. Instead, thePlayerSurface
now has the option to configure if theconfig
passed to it should be loaded immediately or not via thePlayerSurface.autoload
prop. Ifautoload
is set to false, the passed config will be cached but only applied with a call toPlayer.load()
or after settingPlayer.playing = true
.
- Update
@castlabs/prestoplay
to v6.2.7. - Add options to disable or hide seek bar.
- Add
SeekBar.enabled
prop to disable seek bar. - Add
BaseThemeOverlay.seekBar
prop that can be configure with'enabled' | 'disabled' | 'none'
to enable, disable or the hide seek bar.
- Add
- Add
Player.trackLabelerOptions.showVideoBitrate
option to configure track selection UI. This is useful for videos which have multiple qualities of same resolution but at different bitrates. - Fix an issue with
BufferingIndicator
where it was not visible. - Extend
BaseThemeOverlay.startButton
prop. Now it can be passed a config object{ onClick?: () => Promise<void> }
which can override the default on-click behavior. - For
StartButton
- Fix styles.
- Fix issue where it blocks interaction with any other player controls.
- Fix animation of player controls and side menu (slide-in).
- Fix an issue where Escape key press brings up player controls.
- For
PlayerSurface
-
Add
PlayerSurface.playsInline
prop to be used on mobile or iPad. It configures whether player will automatically go to full-screen mode when playback starts or not. -
Add
PlayerSurface.baseConfig
prop to pass initial configuration to PRESTOplay player. (#3)e.g.:
<PlayerSurface player={player} baseConfig={{ license: "..." }} />
-
Fix an issue where event listeners were not being properly detached from the underlying video element on unmount.
-
Fix an error occurring when
PlayerSurface.config
is undefined.
-
- Add a lot of API-level documentation to the modules.
- Add shortcut getters and setters to
Player
.position
(read/write) Use this setter to seek.volume
(read/write).muted
(read/write).live
(read only).rate
(read/write).playing
(read/write).seekRange
(read only).state
(read only).
- Fix seeking logic and avoid unnecessary seeking in a situation where seek is being called repeatedly in a short period of time.
- Improve support for touch screens and touch vs mouse interaction.
- Fix
FullscreenButton
behaviour on iOS devices. Now it by default ignores thefullscreenContainer
props on iOS and displays video element in fullscreen instead. - Fix issue with the default labeler with some HLS content tracks. Now video tracks that do not expose a size are excluded.
- Add support for keyboard control. Use up/down arrow to switch between UI controls, left/right to use sliders, Enter to accept and Escape to go back.
- Add
MuteButton
component intended to mute audio. - Add
HoverContainer
component intended for displaying thumbnails when hovering over the seek bar. - Disable buttons, sliders and other components or hide them when the player is not in an "OK"/"enabled" state.
The player is considered to be in an enabled state e.g. when it is playing and it is not considered
to be in an enabled state e.g. when it is idle or stopped due to an error.
Changes to this state can be subscribed to via
Player.onUIEvent('enabled', ...)
and the current value can be retrieved usingPlayer.enabled
. - Add
useVideoElementForFullscreen
prop to theFullscreenButton
, which allows configuration of whether video element should be displayed in fullscreen mode instead offullscreenContainer
. - Add platform specific
pp-ui-ipad
CSS class to the player controls, overlay and player surface on iPadOS platform.
The first public release.