phenix-web-player-ui
v2018.4.1
Published
Phenix web player ui video element
Downloads
52
Readme
Player
Usage:
var PlayerUI = require('{path-to-module}/phenix-web-player-ui');
...
playerUI = new PlayerUI(elementSelector, {
id: id,
stream: stream,
isSelf: isSelf,
onStreamEnd: onStreamEnd,
defaultAudioEnabled: defaultAudioEnabled,
defaultVideoEnabled: defaultVideoEnabled,
storeLocalStateKey: storeLocalStateKey,
showVideoControl: showVideoControl,
playerViewConfig: playerViewConfig,
muted: false,
autoPlay: true
})
Usage With React:
import PlayerUI from 'phenix-web-player-ui/src/index.js';
...
<PlayerUI
id={id}
stream={stream}
isSelf={isSelf}
onStreamEnd={onStreamEnd}
defaultAudioEnabled={defaultAudioEnabled}
defaultVideoEnabled={defaultVideoEnabled}
storeLocalStateKey={storeLocalStateKey}
showVideoControl={showVideoControl}
playerViewConfig={playerViewConfig}
muted={false}
autoPlay={true}
/>
Usage With Preact:
import PlayerUI from 'phenix-web-player-ui/dist/phenix-react-player';
...
// Same as React
Properties
id
Required property. Unique Id (string type) for the video element. Must be unique across the DOM.
stream
Stream object.
isSelf
Determines whether or not the stream is one that you are publishing and effects mute logic.
onStreamEnd
Function which called when stream is ended.
defaultAudioEnabled
Prop sets default state for audio.
defaultVideoEnabled
Prop sets default state for video.
storeLocalStateKey
Store the state of the audio and the video using local storage if available, else cookies.
playerViewConfig
The object which contains options to adjust which controls are enabled and visible.
Defaults
const defaultPlayerViewConfig = {
playButton: true,
muteAudioButton: true,
muteVideoButton: true,
fullScreenButton: true,
seekBar: true,
rewindButton: true,
overlay: false,
customContextMenu: true,
streamLatency: true,
streamQualities: false
};
muted
Whether or not to start playback with the video muted. Defaults to false except when autoPlay=true and the browser policy forces muted playback.
autoPlay
Whether or not to automatically start playback. Defaults to true