livstream-player
Version:
A lightweight livestream player SDK for React apps
12 lines (11 loc) • 491 B
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import { createContext, useContext, useState } from 'react';
const LivestreamContext = createContext({
streamInfo: {},
setStreamInfo: () => { }
});
export const useLivestream = () => useContext(LivestreamContext);
export const LivestreamProvider = ({ children }) => {
const [streamInfo, setStreamInfo] = useState({});
return (_jsx(LivestreamContext.Provider, { value: { streamInfo, setStreamInfo }, children: children }));
};