Releases: livepeer/ui-kit
@livepeer/[email protected]
Patch Changes
-
#68
8f5e4a3Thanks @victorges! - Allow configuring base URL of Livepeer Studio providerYou can now configure more parameters of the the Livepeer Studio provider,
including specifically thebaseUrlfor 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
461eb4eThanks @0xcadams! - Refactor: modified exports in@livepeer/reactto re-export fromlivepeerandlivepeer/providers/studiofor a better devex. This makes thelivepeerdependency 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
648ddf5Thanks @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
416951dThanks @0xcadams! - Fix: @victorges added default chunk size of 5mb to tus upload, if the input is a stream.
@livepeer/[email protected]
Minor Changes
-
#44
648ddf5Thanks @0xcadams! - Feature: Asset Metrics (useAssetMetrics)useAssetMetricshook 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;
Patch Changes
[email protected]
Minor Changes
-
#27
6635d96Thanks @victorges! - Fix: Improve LivepeerProvider typesTypes are now all documented and extensive for the current version of the Studio
API which is the base for the LivepeerProvider interface.Storage API has also changed slightly, to allow storing an asset in multiple
different storages in the future. Right now it still only supports IPFS, but the
interface is now compatible with adding more storages in the future.Feature: Multistream
The LivepeerProvider now supports the multistream feature. To use it simply add
amultistreamfield with the desired configuration when creating or updating a
Streamobject.const { mutate: createStream } = useCreateStream(); createStream({ name, multistream: { targets: [ { url: 'rtmp://ingest.example.com/rtmp/myStreamKey', }, ], }, });
Feature: Upload progress
Track and show upload progress when creating assets through the
uploadProgressfield in theuseCreateAssethook.function App() { const createAsset = useCreateAsset(); return ( <Button onClick={() => createAsset.mutate({ name, file })}>Create</Button> <Text>Upload progress: {100 * createAsset?.uploadProgress ?? 0}%</Text> ); }
@livepeer/[email protected]
Minor Changes
-
#27
6635d96Thanks @victorges! - Fix: Improve LivepeerProvider typesTypes are now all documented and extensive for the current version of the Studio
API which is the base for the LivepeerProvider interface.Storage API has also changed slightly, to allow storing an asset in multiple
different storages in the future. Right now it still only supports IPFS, but the
interface is now compatible with adding more storages in the future.Feature: Multistream
The LivepeerProvider now supports the multistream feature. To use it simply add
amultistreamfield with the desired configuration when creating or updating a
Streamobject.const { mutate: createStream } = useCreateStream(); createStream({ name, multistream: { targets: [ { url: 'rtmp://ingest.example.com/rtmp/myStreamKey', }, ], }, });
Feature: Upload progress
Track and show upload progress when creating assets through the
uploadProgressfield in theuseCreateAssethook.function App() { const createAsset = useCreateAsset(); return ( <Button onClick={() => createAsset.mutate({ name, file })}>Create</Button> <Text>Upload progress: {100 * createAsset?.uploadProgress ?? 0}%</Text> ); }
Patch Changes
- Updated dependencies [
6635d96]:
[email protected]
Minor Changes
-
#26
94fd2c8Thanks @clacladev! - Feature: added hls.js as a dependency and the creation of an HLS instance to manage a video element and provide HLS and LLHLS support.See below for the API changes:
+ export { createNewHls, isHlsSupported } from './video'; + export type { HlsVideoConfig } from './video';
The
createNewHlscan be used to instantiate a newHlsclass which connects
to the providedHTMLMediaElementto stream HLS video.if (mediaElement && typeof window !== 'undefined' && isHlsSupported()) { const { destroy } = createNewHls(src, mediaElement, hlsConfig); }
The
createNewHlsfunction also instantiates reporting to the provider to provide viewership/general metrics.This allows a user to build their own custom video player using different frameworks other than React, with easy integration with metrics and HLS out of the box.
Patch Changes
-
#34
d3aa654Thanks @0xcadams! - Chore: updatedzustandandethersto latest versions."cross-fetch": "^3.1.5", "hls.js": "^1.2.1", "tus-js-client": "^3.0.0", - "zustand": "^4.0.0" + "zustand": "^4.1.1" }, "devDependencies": { - "@ethersproject/abi": "^5.6.4", - "ethers": "^5.6.9" + "@ethersproject/abi": "^5.7.0", + "ethers": "^5.7.0" },
@livepeer/[email protected]
Minor Changes
-
#26
94fd2c8Thanks @clacladev! - Feature: added aVideoPlayercomponent to provide HLS and LLHLS video streaming.See below for the API changes:
+ export { VideoPlayer } from './components';The
VideoPlayercomponent uses hls.js under the hood and creates a newHTMLVideoElementand adds event handlers for metrics reporting.import { VideoPlayer } from '@livepeer/react'; const playbackId = 'abcde6mykgkvtxav'; function App() { return <VideoPlayer playbackId={playbackId} />; }
The
VideoPlayerrequires aplaybackIdorsrcprop to be passed, with theplaybackIdautomatically used to fetch the playback URL from the provider.
Patch Changes
-
#34
d3aa654Thanks @0xcadams! - Chore: updatedreact-query,ethers, andwagmito latest versions."dependencies": { - "@tanstack/query-sync-storage-persister": "4.0.10", - "@tanstack/react-query": "4.1.3", - "@tanstack/react-query-persist-client": "4.0.10", + "@tanstack/query-sync-storage-persister": "4.2.3", + "@tanstack/react-query": "4.2.3", + "@tanstack/react-query-persist-client": "4.2.1", "use-sync-external-store": "^1.2.0" }, "devDependencies": { - "@testing-library/react": "^13.3.0", + "@testing-library/react": "^13.4.0", "@testing-library/react-hooks": "^8.0.1", - "@types/react": "^18.0.17", + "@types/react": "^18.0.18", "@types/react-dom": "^18.0.6", "@types/use-sync-external-store": "^0.0.3", - "ethers": "^5.6.9", + "ethers": "^5.7.0", "livepeer": "^0.2.2", "react": "^18.2.0", "react-dom": "^18.2.0", - "wagmi": "^0.6.3" + "wagmi": "^0.6.4" }, "keywords": [ "dapps",
[email protected]
Patch Changes
-
#5
97c56f6Thanks @0xcadams! - Updated the default studio API key to use a new, tracked (and rate-limited) version.-export const defaultStudioApiKey = '182188f3-3ddf-4dc2-9889-79ecb17a26c9'; +export const defaultStudioApiKey = '4991930c-f9ae-46a0-a2a8-488c466da778';
Updated the types on
CreateAssetArgsto includeReadStreamfor node.js environments.export type CreateAssetArgs = { name: string; - file: File; + file: File | ReadStream; };
@livepeer/[email protected]
Patch Changes
-
#5
97c56f6Thanks @0xcadams! - Updated the default studio API key to use a new, tracked (and rate-limited) version.-export const defaultStudioApiKey = '182188f3-3ddf-4dc2-9889-79ecb17a26c9'; +export const defaultStudioApiKey = '4991930c-f9ae-46a0-a2a8-488c466da778';
Updated the types on
CreateAssetArgsto includeReadStreamfor node.js environments.export type CreateAssetArgs = { name: string; - file: File; + file: File | ReadStream; };