Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@videosdk.live/react-sdk

Package Overview
Dependencies
Maintainers
2
Versions
134
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@videosdk.live/react-sdk - npm Package Compare versions

Comparing version 0.0.20 to 0.0.21

108

dist/index.js

@@ -24,4 +24,4 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }

'live-stream-stopped': eventPrifix + "-live-stream-stopped",
'video-started': eventPrifix + "-video-started",
'video-stopped': eventPrifix + "-video-stopped"
'video-state-changed': eventPrifix + "-video-state-changed",
'video-seeked': eventPrifix + "-video-seeked"
};

@@ -62,6 +62,6 @@ var eventEmitter = new EventEmitter();

onLiveStreamStopped = _ref$onLiveStreamStop === void 0 ? function () {} : _ref$onLiveStreamStop,
_ref$onVideoStarted = _ref.onVideoStarted,
onVideoStarted = _ref$onVideoStarted === void 0 ? function () {} : _ref$onVideoStarted,
_ref$onVideoStopped = _ref.onVideoStopped,
onVideoStopped = _ref$onVideoStopped === void 0 ? function () {} : _ref$onVideoStopped;
_ref$onVideoStateChan = _ref.onVideoStateChanged,
onVideoStateChanged = _ref$onVideoStateChan === void 0 ? function () {} : _ref$onVideoStateChan,
_ref$onVideoSeeked = _ref.onVideoSeeked,
onVideoSeeked = _ref$onVideoSeeked === void 0 ? function () {} : _ref$onVideoSeeked;

@@ -83,4 +83,4 @@ React.useEffect(function () {

eventEmitter.on(events['live-stream-stopped'], onLiveStreamStopped);
eventEmitter.on(events['video-started'], onVideoStarted);
eventEmitter.on(events['video-stopped'], onVideoStopped);
eventEmitter.offon(events['video-state-changed'], onVideoStateChanged);
eventEmitter.offon(events['video-seeked'], onVideoSeeked);
return function () {

@@ -101,4 +101,4 @@ eventEmitter.off(events['participant-joined'], onParticipantJoined);

eventEmitter.off(events['live-stream-stopped'], onLiveStreamStopped);
eventEmitter.off(events['video-started'], onVideoStarted);
eventEmitter.off(events['video-stopped'], onVideoStopped);
eventEmitter.off(events['video-state-changed'], onVideoStateChanged);
eventEmitter.off(events['video-seeked'], onVideoSeeked);
};

@@ -138,6 +138,6 @@ }, []);

onLiveStreamStopped = _ref2$onLiveStreamSto === void 0 ? function () {} : _ref2$onLiveStreamSto,
_ref2$onVideoStarted = _ref2.onVideoStarted,
onVideoStarted = _ref2$onVideoStarted === void 0 ? function () {} : _ref2$onVideoStarted,
_ref2$onVideoStopped = _ref2.onVideoStopped,
onVideoStopped = _ref2$onVideoStopped === void 0 ? function () {} : _ref2$onVideoStopped;
_ref2$onVideoStateCha = _ref2.onVideoStateChanged,
onVideoStateChanged = _ref2$onVideoStateCha === void 0 ? function () {} : _ref2$onVideoStateCha,
_ref2$onVideoSeeked = _ref2.onVideoSeeked,
onVideoSeeked = _ref2$onVideoSeeked === void 0 ? function () {} : _ref2$onVideoSeeked;
React.useEffect(function () {

@@ -158,4 +158,4 @@ eventEmitter.on(events['participant-joined'], onParticipantJoined);

eventEmitter.on(events['live-stream-disabled'], onLiveStreamStopped);
eventEmitter.on(events['video-started'], onVideoStarted);
eventEmitter.on(events['video-stopped'], onVideoStopped);
eventEmitter.on(events['video-state-changed'], onVideoStateChanged);
eventEmitter.on(events['video-seeked'], onVideoSeeked);
return function () {

@@ -176,4 +176,4 @@ eventEmitter.off(events['participant-joined'], onParticipantJoined);

eventEmitter.off(events['live-stream-disabled'], onLiveStreamStopped);
eventEmitter.off(events['video-started'], onVideoStarted);
eventEmitter.off(events['video-stopped'], onVideoStopped);
eventEmitter.off(events['video-state-changed'], onVideoStateChanged);
eventEmitter.off(events['video-seeked'], onVideoSeeked);
};

@@ -234,13 +234,6 @@ }, []);

var _useState12 = React.useState({
currentTime: 0,
link: ''
}),
externalVideo = _useState12[0],
setExternalVideo = _useState12[1];
var _useState12 = React.useState(false),
isLiveStreaming = _useState12[0],
setIsLiveStreaming = _useState12[1];
var _useState13 = React.useState(false),
isLiveStreaming = _useState13[0],
setIsLiveStreaming = _useState13[1];
var meetingRef = React.useRef();

@@ -279,6 +272,2 @@ var localMicOnRef = React.useRef();

setMessages([]);
setExternalVideo({
currentTime: 0,
link: ''
});
setIsLiveStreaming(false);

@@ -386,13 +375,8 @@ };

var _handle_video_started = function _handle_video_started(data) {
setExternalVideo(data);
eventEmitter.emit(events['video-started'], data);
var _handle_video_state_changed = function _handle_video_state_changed(data) {
eventEmitter.emit(events['video-state-changed'], data);
};
var _handle_video_stopped = function _handle_video_stopped(data) {
setExternalVideo({
currentTime: 0,
link: ''
});
eventEmitter.emit(events['video-stopped'], data);
var _handle_video_seeked = function _handle_video_seeked(data) {
eventEmitter.emit(events['video-seeked'], data);
};

@@ -422,4 +406,4 @@

meeting.on('livestream-stopped', _handle_live_stream_stopped);
meeting.on('video-started', _handle_video_started);
meeting.on('video-stopped', _handle_video_stopped);
meeting.on('video-state-changed', _handle_video_state_changed);
meeting.on('video-seeked', _handle_video_seeked);
meeting.localParticipant.on('stream-enabled', _handle_localParticipant_stream_enabled);

@@ -451,4 +435,4 @@ meeting.localParticipant.on('stream-disabled', _handle_localParticipant_stream_disabled);

meeting.off('livestream-stopped', _handle_live_stream_stopped);
meeting.off('video-started', _handle_video_started);
meeting.off('video-stopped', _handle_video_stopped);
meeting.off('video-state-changed', _handle_video_state_changed);
meeting.off('video-seeked', _handle_video_seeked);
}

@@ -649,2 +633,32 @@

var resumeVideo = function resumeVideo() {
var meeting = meetingRef.current;
if (meeting) {
meeting.resumeVideo();
}
};
var pauseVideo = function pauseVideo(_ref3) {
var currentTime = _ref3.currentTime;
var meeting = meetingRef.current;
if (meeting) {
meeting.pauseVideo({
currentTime: currentTime
});
}
};
var seekVideo = function seekVideo(_ref4) {
var currentTime = _ref4.currentTime;
var meeting = meetingRef.current;
if (meeting) {
meeting.seekVideo({
currentTime: currentTime
});
}
};
var startLivestream = function startLivestream(streamInfo) {

@@ -691,3 +705,2 @@ var meeting = meetingRef.current;

isRecording: isRecording,
externalVideo: externalVideo,
isLiveStreaming: isLiveStreaming,

@@ -716,2 +729,5 @@ join: join,

stopVideo: stopVideo,
resumeVideo: resumeVideo,
pauseVideo: pauseVideo,
seekVideo: seekVideo,
startLivestream: startLivestream,

@@ -718,0 +734,0 @@ stopLivestream: stopLivestream

@@ -21,4 +21,4 @@ import React, { createContext, useEffect, useContext, useState, useRef } from 'react';

'live-stream-stopped': eventPrifix + "-live-stream-stopped",
'video-started': eventPrifix + "-video-started",
'video-stopped': eventPrifix + "-video-stopped"
'video-state-changed': eventPrifix + "-video-state-changed",
'video-seeked': eventPrifix + "-video-seeked"
};

@@ -59,6 +59,6 @@ var eventEmitter = new EventEmitter();

onLiveStreamStopped = _ref$onLiveStreamStop === void 0 ? function () {} : _ref$onLiveStreamStop,
_ref$onVideoStarted = _ref.onVideoStarted,
onVideoStarted = _ref$onVideoStarted === void 0 ? function () {} : _ref$onVideoStarted,
_ref$onVideoStopped = _ref.onVideoStopped,
onVideoStopped = _ref$onVideoStopped === void 0 ? function () {} : _ref$onVideoStopped;
_ref$onVideoStateChan = _ref.onVideoStateChanged,
onVideoStateChanged = _ref$onVideoStateChan === void 0 ? function () {} : _ref$onVideoStateChan,
_ref$onVideoSeeked = _ref.onVideoSeeked,
onVideoSeeked = _ref$onVideoSeeked === void 0 ? function () {} : _ref$onVideoSeeked;

@@ -80,4 +80,4 @@ useEffect(function () {

eventEmitter.on(events['live-stream-stopped'], onLiveStreamStopped);
eventEmitter.on(events['video-started'], onVideoStarted);
eventEmitter.on(events['video-stopped'], onVideoStopped);
eventEmitter.offon(events['video-state-changed'], onVideoStateChanged);
eventEmitter.offon(events['video-seeked'], onVideoSeeked);
return function () {

@@ -98,4 +98,4 @@ eventEmitter.off(events['participant-joined'], onParticipantJoined);

eventEmitter.off(events['live-stream-stopped'], onLiveStreamStopped);
eventEmitter.off(events['video-started'], onVideoStarted);
eventEmitter.off(events['video-stopped'], onVideoStopped);
eventEmitter.off(events['video-state-changed'], onVideoStateChanged);
eventEmitter.off(events['video-seeked'], onVideoSeeked);
};

@@ -135,6 +135,6 @@ }, []);

onLiveStreamStopped = _ref2$onLiveStreamSto === void 0 ? function () {} : _ref2$onLiveStreamSto,
_ref2$onVideoStarted = _ref2.onVideoStarted,
onVideoStarted = _ref2$onVideoStarted === void 0 ? function () {} : _ref2$onVideoStarted,
_ref2$onVideoStopped = _ref2.onVideoStopped,
onVideoStopped = _ref2$onVideoStopped === void 0 ? function () {} : _ref2$onVideoStopped;
_ref2$onVideoStateCha = _ref2.onVideoStateChanged,
onVideoStateChanged = _ref2$onVideoStateCha === void 0 ? function () {} : _ref2$onVideoStateCha,
_ref2$onVideoSeeked = _ref2.onVideoSeeked,
onVideoSeeked = _ref2$onVideoSeeked === void 0 ? function () {} : _ref2$onVideoSeeked;
useEffect(function () {

@@ -155,4 +155,4 @@ eventEmitter.on(events['participant-joined'], onParticipantJoined);

eventEmitter.on(events['live-stream-disabled'], onLiveStreamStopped);
eventEmitter.on(events['video-started'], onVideoStarted);
eventEmitter.on(events['video-stopped'], onVideoStopped);
eventEmitter.on(events['video-state-changed'], onVideoStateChanged);
eventEmitter.on(events['video-seeked'], onVideoSeeked);
return function () {

@@ -173,4 +173,4 @@ eventEmitter.off(events['participant-joined'], onParticipantJoined);

eventEmitter.off(events['live-stream-disabled'], onLiveStreamStopped);
eventEmitter.off(events['video-started'], onVideoStarted);
eventEmitter.off(events['video-stopped'], onVideoStopped);
eventEmitter.off(events['video-state-changed'], onVideoStateChanged);
eventEmitter.off(events['video-seeked'], onVideoSeeked);
};

@@ -231,13 +231,6 @@ }, []);

var _useState12 = useState({
currentTime: 0,
link: ''
}),
externalVideo = _useState12[0],
setExternalVideo = _useState12[1];
var _useState12 = useState(false),
isLiveStreaming = _useState12[0],
setIsLiveStreaming = _useState12[1];
var _useState13 = useState(false),
isLiveStreaming = _useState13[0],
setIsLiveStreaming = _useState13[1];
var meetingRef = useRef();

@@ -276,6 +269,2 @@ var localMicOnRef = useRef();

setMessages([]);
setExternalVideo({
currentTime: 0,
link: ''
});
setIsLiveStreaming(false);

@@ -383,13 +372,8 @@ };

var _handle_video_started = function _handle_video_started(data) {
setExternalVideo(data);
eventEmitter.emit(events['video-started'], data);
var _handle_video_state_changed = function _handle_video_state_changed(data) {
eventEmitter.emit(events['video-state-changed'], data);
};
var _handle_video_stopped = function _handle_video_stopped(data) {
setExternalVideo({
currentTime: 0,
link: ''
});
eventEmitter.emit(events['video-stopped'], data);
var _handle_video_seeked = function _handle_video_seeked(data) {
eventEmitter.emit(events['video-seeked'], data);
};

@@ -419,4 +403,4 @@

meeting.on('livestream-stopped', _handle_live_stream_stopped);
meeting.on('video-started', _handle_video_started);
meeting.on('video-stopped', _handle_video_stopped);
meeting.on('video-state-changed', _handle_video_state_changed);
meeting.on('video-seeked', _handle_video_seeked);
meeting.localParticipant.on('stream-enabled', _handle_localParticipant_stream_enabled);

@@ -448,4 +432,4 @@ meeting.localParticipant.on('stream-disabled', _handle_localParticipant_stream_disabled);

meeting.off('livestream-stopped', _handle_live_stream_stopped);
meeting.off('video-started', _handle_video_started);
meeting.off('video-stopped', _handle_video_stopped);
meeting.off('video-state-changed', _handle_video_state_changed);
meeting.off('video-seeked', _handle_video_seeked);
}

@@ -646,2 +630,32 @@

var resumeVideo = function resumeVideo() {
var meeting = meetingRef.current;
if (meeting) {
meeting.resumeVideo();
}
};
var pauseVideo = function pauseVideo(_ref3) {
var currentTime = _ref3.currentTime;
var meeting = meetingRef.current;
if (meeting) {
meeting.pauseVideo({
currentTime: currentTime
});
}
};
var seekVideo = function seekVideo(_ref4) {
var currentTime = _ref4.currentTime;
var meeting = meetingRef.current;
if (meeting) {
meeting.seekVideo({
currentTime: currentTime
});
}
};
var startLivestream = function startLivestream(streamInfo) {

@@ -688,3 +702,2 @@ var meeting = meetingRef.current;

isRecording: isRecording,
externalVideo: externalVideo,
isLiveStreaming: isLiveStreaming,

@@ -713,2 +726,5 @@ join: join,

stopVideo: stopVideo,
resumeVideo: resumeVideo,
pauseVideo: pauseVideo,
seekVideo: seekVideo,
startLivestream: startLivestream,

@@ -715,0 +731,0 @@ stopLivestream: stopLivestream

{
"name": "@videosdk.live/react-sdk",
"version": "0.0.20",
"version": "0.0.21",
"license": "ISC",

@@ -61,5 +61,5 @@ "main": "dist/index.js",

"dependencies": {
"@videosdk.live/js-sdk": "^0.0.9",
"@videosdk.live/js-sdk": "^0.0.11",
"events": "^3.3.0"
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc