Releases: livepeer/ui-kit
@livepeer/[email protected]
@livepeer/[email protected]
Patch Changes
-
#75
73f37ad
Thanks @0xcadams! - Fix: fixed too strict types on<Player />
, background play/pause click handler not working without a poster element, theme overrides without a global theme, and styling for the container to take up the parent width and maintain aspect ratio. -
Updated dependencies [
73f37ad
]:
[email protected]
Major Changes
-
#42
ea9d083
Thanks @0xcadams! - Fix: moved all contract interactions to a separate subpackage, to remove the need for theethers
/wagmi
peer dependencies.+import { + ArbRetryableTxABI, + BondingManagerABI, + ControllerABI, + InboxABI, + L1BondingManagerABI, + L1MigratorABI, + L2LPTGatewayABI, + L2MigratorABI, + LivepeerTokenABI, + LivepeerTokenFaucetABI, + MerkleSnapshotABI, + MinterABI, + NodeInterfaceABI, + PollABI, + PollCreatorABI, + RoundsManagerABI, + ServiceRegistryABI, + TicketBrokerABI, + allChainId, + arbitrumOneAddress, + arbitrumRinkebyAddress, + mainnetAddress, + mainnetChainId, + rinkebyAddress, + testnetChainId, + getBondingManager, + getContractAddressFromController, + getController, + getL1Migrator, + getL2Migrator, + getLivepeerToken, + getLivepeerTokenFaucet, + getMerkleSnapshot, + getMinter, + getPollCreator, + getRoundsManager, + getServiceRegistry, + getTicketBroker, + ArbRetryableTxFactory, + BondingManagerFactory, + ControllerFactory, + InboxFactory, + L1BondingManagerFactory, + L1MigratorFactory, + L2LPTGatewayFactory, + L2MigratorFactory, + LivepeerTokenFactory, + LivepeerTokenFaucetFactory, + MerkleSnapshotFactory, + MinterFactory, + NodeInterfaceFactory, + PollCreatorFactory, + PollFactory, + RoundsManagerFactory, + ServiceRegistryFactory, + TicketBrokerFactory, +} from 'livepeer/contracts'; +import type { + L1Address, + L1LivepeerChain, + L1LivepeerChainId, + L2Address, + L2LivepeerChain, + L2LivepeerChainId, + LivepeerAddress, + LivepeerChain, + LivepeerChainId, + MainnetLivepeerChain, + MainnetLivepeerChainId, + TestnetLivepeerChain, + TestnetLivepeerChainId, + ArbRetryableTx, + BondingManager, + Controller, + Inbox, + L1BondingManager, + L1Migrator, + L2LPTGateway, + L2Migrator, + LivepeerToken, + LivepeerTokenFaucet, + MerkleSnapshot, + Minter, + NodeInterface, + Poll, + PollCreator, + RoundsManager, + ServiceRegistry, + TicketBroker, +} from 'livepeer/contracts';
Minor Changes
-
#42
ea9d083
Thanks @0xcadams! - Feature: added styling for media player components using@stitches/core
and polyfilling usingcore-js
.Added a core vanilla JS store based on Zustand, w/ state propagated to/from a media element (see
MediaControllerState
andMediaControllerStore
). Also added more helper functions for validating/constructing media sources and mime types, theming, and browser interactions.The following updates were made to
package.json
:}, "peerDependenciesMeta": {}, "dependencies": { + "@stitches/core": "^1.2.8", + "core-js": "^3.25.2", "cross-fetch": "^3.1.5", "hls.js": "^1.2.1", "tus-js-client": "^3.0.0",
The following updates were made to the exports from
livepeer
:TestnetLivepeerChainId, } from './constants'; export { HttpError, IncorrectChainIdError } from './errors'; +export { + addEventListeners, + canPlayMediaNatively, + createControllerStore, + createNewHls, + createPlayerTheme, + defaultTheme, + getCssText, + getMediaSourceType, + getMetricsReportingUrl, + isHlsSupported, + MetricsStatus, + PlaybackMonitor, + reportMediaMetrics, + styling, +} from './media'; +export type { + AspectRatio, + AudioSrc, + ControlsOptions, + HlsSrc, + HlsVideoConfig, + MediaControllerState, + MediaControllerStore, + PlaybackRecord, + RawMetrics, + Src, + ThemeConfig, + VideoSrc, +} from './media'; export { createStorage, noopStorage } from './storage'; export type { ClientStorage as Storage } from './storage'; ... UpdateStreamArgs, ViewsMetrics, } from './types'; -export { pick } from './utils'; -export { - createNewHls, - getMetricsReportingUrl, - isHlsSupported, - MetricsStatus, - PlaybackMonitor, - reportVideoMetrics, -} from './video'; -export type { HlsVideoConfig, PlaybackRecord, RawMetrics } from './video'; +export { deepMerge, pick } from './utils';
Patch Changes
@livepeer/[email protected]
@livepeer/[email protected]
Minor Changes
-
#42
ea9d083
Thanks @0xcadams! - Feature: added a new<Player />
component and deprecated the previous<VideoPlayer />
. Also added polyfills usingcore-js
andbrowserslist
to support major global browsers.See
livepeer
for the corresponding core JS updates.The following updates were made to the exports from
@livepeer/react
:export { arbitrumRinkebyAddress, ArbRetryableTxABI, BondingManagerABI, + canPlayMediaNatively, Client, ControllerABI, + createPlayerTheme, createStorage, defaultStudioApiKey, + defaultTheme, defaultTranscodingProfiles, + getCssText, + getMediaSourceType, InboxABI, + isHlsSupported, L1BondingManagerABI, L1MigratorABI, L2LPTGatewayABI, @@ -28,16 +34,20 @@ export { RoundsManagerABI, ServiceRegistryABI, studio, + styling, testnetChainId, TicketBrokerABI, } from 'livepeer'; export type { Address, ArbRetryableTx, + AspectRatio, Asset, + AudioSrc, BondingManager, ClientConfig, Controller, + ControlsOptions, CreateAssetArgs, CreateStreamArgs, GetAssetArgs, @@ -47,6 +57,7 @@ export type { GetStreamSessionArgs, GetStreamSessionsArgs, Hash, + HlsSrc, HlsVideoConfig, HttpError, Inbox, @@ -71,6 +82,8 @@ export type { LivepeerTokenFaucet, MainnetLivepeerChain, MainnetLivepeerChainId, + MediaControllerState, + MediaControllerStore, MerkleSnapshot, Metrics, Minter, @@ -83,15 +96,18 @@ export type { PollCreator, RoundsManager, ServiceRegistry, + Src, Storage, Stream, StreamSession, TestnetLivepeerChain, TestnetLivepeerChainId, + ThemeConfig, TicketBroker, TranscodingProfile, UpdateAssetArgs, UpdateStreamArgs, + VideoSrc, WatchLivepeerProviderCallback, } from 'livepeer'; export { @@ -100,7 +116,34 @@ export { } from 'livepeer/providers/studio'; export { createReactClient } from './client'; export type { CreateReactClientConfig, ReactClient } from './client'; -export { VideoPlayer } from './components'; +export { + ControlsContainer, + FullscreenButton, + MediaControllerProvider, + PlayButton, + Player, + Poster, + Progress, + ThemeProvider, + TimeDisplay, + Title, + useMediaController, + useTheme, + Volume, +} from './components'; +export type { + ControlsContainerProps, + FullscreenButtonProps, + MediaControllerProviderProps, + PlayButtonProps, + PlayerProps, + PosterProps, + ProgressProps, + ThemeProviderProps, + TimeDisplayProps, + TitleProps, + VolumeProps, +} from './components'; export { Context, LivepeerConfig, useClient } from './context'; export type { LivepeerConfigProps } from './context'; export {
-
#42
ea9d083
Thanks @0xcadams! - Fix: moved all contract interactions to a separate subpackage, to remove the need for theethers
/wagmi
peer dependencies.+import { + useBondingManager, + useController, + useL1Migrator, + useL2Migrator, + useLivepeerToken, + useLivepeerTokenFaucet, + useMerkleSnapshot, + useMinter, + usePollCreator, + useRoundsManager, + useServiceRegistry, + useTicketBroker, +} from '@livepeer/react/contracts';
Patch Changes
[email protected]
Patch Changes
-
#68
8f5e4a3
Thanks @victorges! - Allow configuring base URL of Livepeer Studio providerYou can now configure more parameters of the the Livepeer Studio provider,
including specifically thebaseUrl
for the API calls.const livepeer = createReactClient({ provider: studioProvider({ baseUrl: 'https://studio.my-domain.com/root/api', apiKey: '123-abcd', }), });
@livepeer/[email protected]
Patch Changes
-
#68
8f5e4a3
Thanks @victorges! - Allow configuring base URL of Livepeer Studio providerYou can now configure more parameters of the the Livepeer Studio provider,
including specifically thebaseUrl
for the API calls.const livepeer = createReactClient({ provider: studioProvider({ baseUrl: 'https://studio.my-domain.com/root/api', apiKey: '123-abcd', }), });
@livepeer/[email protected]
Minor Changes
-
#47
461eb4e
Thanks @0xcadams! - Refactor: modified exports in@livepeer/react
to re-export fromlivepeer
andlivepeer/providers/studio
for a better devex. This makes thelivepeer
dependency unnecessary for React projects.+export { + allChainId, + arbitrumOneAddress, + arbitrumRinkebyAddress, + ArbRetryableTxABI, + BondingManagerABI, + Client, + ControllerABI, + createStorage, + defaultStudioApiKey, + defaultTranscodingProfiles, + InboxABI, + L1BondingManagerABI, + L1MigratorABI, + L2LPTGatewayABI, + L2MigratorABI, + LivepeerTokenABI, + LivepeerTokenFaucetABI, + mainnetAddress, + mainnetChainId, + MerkleSnapshotABI, + MinterABI, + NodeInterfaceABI, + noopStorage, + PollABI, + PollCreatorABI, + rinkebyAddress, + RoundsManagerABI, + ServiceRegistryABI, + studio, + testnetChainId, + TicketBrokerABI, +} from 'livepeer'; +export type { + Address, + ArbRetryableTx, + Asset, + BondingManager, + ClientConfig, + Controller, + CreateAssetArgs, + CreateStreamArgs, + GetAssetArgs, + GetLivepeerProviderResult, + GetPlaybackInfoArgs, + GetStreamArgs, + GetStreamSessionArgs, + GetStreamSessionsArgs, + Hash, + HlsVideoConfig, + HttpError, + Inbox, + IncorrectChainIdError, + L1Address, + L1BondingManager, + L1LivepeerChain, + L1LivepeerChainId, + L1Migrator, + L2Address, + L2LivepeerChain, + L2LivepeerChainId, + L2LPTGateway, + L2Migrator, + LivepeerAddress, + LivepeerChain, + LivepeerChainId, + LivepeerProvider, + LivepeerProviderConfig, + LivepeerProviderName, + LivepeerToken, + LivepeerTokenFaucet, + MainnetLivepeerChain, + MainnetLivepeerChainId, + MerkleSnapshot, + Metrics, + Minter, + MultistreamTarget, + MultistreamTargetRef, + NodeInterface, + PlaybackInfo, + PlaybackRecord, + Poll, + PollCreator, + RoundsManager, + ServiceRegistry, + Storage, + Stream, + StreamSession, + TestnetLivepeerChain, + TestnetLivepeerChainId, + TicketBroker, + TranscodingProfile, + UpdateAssetArgs, + UpdateStreamArgs, + WatchLivepeerProviderCallback, +} from 'livepeer'; +export { + studioProvider, + type StudioLivepeerProviderConfig, +} from 'livepeer/providers/studio'; export { createReactClient } from './client'; export type { CreateReactClientConfig, + ReactClient, } from './client'; export { VideoPlayer } from './components';
[email protected]
Minor Changes
-
#44
648ddf5
Thanks @0xcadams! - Feature: Asset MetricsThere is now support for asset metrics, with start views count being returned
when metrics have been reported to the correct reporting URL (this is handled in
@livepeer/react
'sVideoPlayer
).const metrics = getAssetMetrics({ assetId }); const viewCount = metrics?.metrics?.[0]?.startViews ?? 0;
Patch Changes
416951d
Thanks @0xcadams! - Fix: @victorges added default chunk size of 5mb to tus upload, if the input is a stream.
@livepeer/[email protected]
Minor Changes
-
#44
648ddf5
Thanks @0xcadams! - Feature: Asset Metrics (useAssetMetrics
)useAssetMetrics
hook has been added for fetching asset metrics. This hook will update
when viewership metrics have been reported to the correct reporting URL (this is handled in
@livepeer/react
'sVideoPlayer
).const { data: metrics } = useAssetMetrics({ assetId: createdAsset?.id, refetchInterval: (metrics) => (!metrics ? 30000 : false), }); const viewCount = metrics?.metrics?.[0]?.startViews ?? 0;