@impleotv/stanag-player 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/StanagPlayer/StanagPlayer.d.ts +6 -3
- package/dist/cjs/components/StanagPlayer/StanagPlayer.stories.d.ts +2 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/components/StanagPlayer/StanagPlayer.d.ts +6 -3
- package/dist/esm/components/StanagPlayer/StanagPlayer.stories.d.ts +2 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +6 -3
- package/package.json +1 -1
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export interface StanagPlayerProps {
|
|
3
3
|
serverUrl?: string;
|
|
4
|
+
width: number;
|
|
5
|
+
defaultAspectRatio?: number;
|
|
4
6
|
controls?: boolean;
|
|
5
7
|
autoplay?: boolean;
|
|
6
8
|
iceServers?: string;
|
|
7
|
-
onDataReceive?(packetTime: string, klvs: JSON):
|
|
8
|
-
onConnected?(isConnected: boolean):
|
|
9
|
-
onError?(error: string):
|
|
9
|
+
onDataReceive?(packetTime: string, klvs: JSON): void;
|
|
10
|
+
onConnected?(isConnected: boolean): void;
|
|
11
|
+
onError?(error: string): void;
|
|
10
12
|
}
|
|
11
13
|
declare const StanagPlayer: {
|
|
12
14
|
(props: StanagPlayerProps): JSX.Element;
|
|
13
15
|
defaultProps: {
|
|
16
|
+
width: number;
|
|
14
17
|
controls: boolean;
|
|
15
18
|
autoplay: boolean;
|
|
16
19
|
iceServers: string;
|
|
@@ -3,6 +3,7 @@ import { ComponentStory, ComponentMeta } from '@storybook/react';
|
|
|
3
3
|
declare const _default: ComponentMeta<{
|
|
4
4
|
(props: import("./StanagPlayer").StanagPlayerProps): JSX.Element;
|
|
5
5
|
defaultProps: {
|
|
6
|
+
width: number;
|
|
6
7
|
controls: boolean;
|
|
7
8
|
autoplay: boolean;
|
|
8
9
|
iceServers: string;
|
|
@@ -12,6 +13,7 @@ export default _default;
|
|
|
12
13
|
export declare const Player: ComponentStory<{
|
|
13
14
|
(props: import("./StanagPlayer").StanagPlayerProps): JSX.Element;
|
|
14
15
|
defaultProps: {
|
|
16
|
+
width: number;
|
|
15
17
|
controls: boolean;
|
|
16
18
|
autoplay: boolean;
|
|
17
19
|
iceServers: string;
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react");function
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=t(e),o=function(t){e.useRef(null);var o=e.useRef(null),r=e.useRef(!0),c=e.useState(16/9),a=c[0],i=c[1],s=e.useState({width:t.width,height:t.width/a}),d=s[0],u=s[1],l=e.useState({width:1920,height:1080}),h=l[0],f=l[1],g={iceServers:[{urls:t.iceServers}]};e.useEffect((function(){try{v.ontrack=function(e){null!=o.current&&(o.current.srcObject=e.streams[0],o.current.muted=!0,o.current.autoplay=t.autoplay,o.current.controls=t.controls,o.current.addEventListener("pause",(function(e){r.current=!0})),o.current.addEventListener("play",(function(e){r.current=!1})),o.current.addEventListener("loadedmetadata",(function(e){f({width:o.current.videoWidth,height:o.current.videoHeight})})))},v.onconnectionstatechange=function(e){return console.log(v.iceConnectionState)},v.oniceconnectionstatechange=function(e){return console.log(v.iceConnectionState)},v.onicegatheringstatechange=function(e){return console.log(v.iceGatheringState)},v.addTransceiver("video",{direction:"sendrecv"});var e=v.createDataChannel("klv");e.binaryType="arraybuffer",e.onclose=function(){return console.log("dataChannel has closed")},e.onopen=function(){return console.log("dataChannel has opened")},e.onmessage=function(e){if(!r.current){var n=new DataView(e.data),o=new TextDecoder("utf8"),c=JSON.parse(o.decode(n)),a=(c.packetTime,c.klvs);t.onDataReceive&&t.onDataReceive(new Date(a[2]/1e3).toISOString(),a)}};var n=t.serverUrl?t.serverUrl:window.location.origin,c=new URL(n),a="ws";"http:"!=c.protocol&&(a+="s");var i=new WebSocket(a+"://".concat(c.host,"/ws"));i.onmessage=function(e){var t=JSON.parse(e.data);if(!t)return console.log("failed to parse msg");t.candidate?v.addIceCandidate(t):v.setRemoteDescription(t)},i.onerror=function(e){console.log("Websocket Error.")},i.onclose=function(e){t.onConnected&&t.onConnected(!1),1e3!=e.code&&(t.onError&&console.log("Websocket closed: ".concat(e.code)),t.onError("Websocket error: ".concat(e.code)))},v.onicecandidate=function(e){e.candidate&&""!==e.candidate.candidate&&i.send(JSON.stringify(e.candidate))},i.onopen=function(){t.onConnected&&t.onConnected(!0),v.createOffer().then((function(e){v.setLocalDescription(e),i.send(JSON.stringify(e))}))}}catch(e){console.log("Error: ".concat(e.message))}}),[]),e.useEffect((function(){try{console.log("Video dimensions: ".concat(h.width,"x").concat(h.height));var e=h.width/h.height;i(e),u({width:t.width,height:t.width/e})}catch(e){}}),[h.width,h.height,t.width]);var v=new RTCPeerConnection(g),w={width:d.width,height:d.height};return n.default.createElement("video",{style:w,ref:o})};o.defaultProps={width:360,controls:!0,autoplay:!0,iceServers:"stun:stun.l.google.com:19302"};var r=function(e){return n.default.createElement(r,null,e.label)};exports.KlvView=r,exports.StanagPlayer=o;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/components/StanagPlayer/StanagPlayer.tsx","../../src/components/KlvView/KlvView.tsx"],"sourcesContent":[null,null],"names":["StanagPlayer","props","
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/components/StanagPlayer/StanagPlayer.tsx","../../src/components/KlvView/KlvView.tsx"],"sourcesContent":[null,null],"names":["StanagPlayer","props","useRef","videoPlayer","isPaused","_a","useState","aspectRatio","setAspectRatio","_b","width","height","playerSize","setPlayerSize","_c","videoDimension","setVideoDimension","configuration","iceServers","urls","useEffect","pc","ontrack","event","current","srcObject","streams","muted","autoplay","controls","addEventListener","videoWidth","videoHeight","onconnectionstatechange","e","console","log","iceConnectionState","oniceconnectionstatechange","onicegatheringstatechange","iceGatheringState","addTransceiver","direction","dataChannel","createDataChannel","binaryType","onclose","onopen","onmessage","dataView","DataView","data","decoder","TextDecoder","JSON","parse","decode","klvs","onDataReceive","Date","toISOString","location_1","serverUrl","window","location","origin","uri","URL","wsProto","protocol","socket_1","WebSocket","concat","host","msg","candidate","addIceCandidate","setRemoteDescription","onerror","onConnected","code","onError","onicecandidate","send","stringify","createOffer","then","offer","setLocalDescription","error","message","curAspectRatio","RTCPeerConnection","playerStyle","React","createElement","style","ref","defaultProps","KlvView","label"],"mappings":"8KAmBMA,EAAe,SAACC,GACGC,EAAAA,OAAoB,MAC3C,IAAMC,EAAcD,SAAO,MACrBE,EAAWF,UAAO,GAClBG,EAAgCC,EAAAA,SAAS,GAAG,GAA3CC,EAAWF,EAAA,GAAEG,OACdC,EAA8BH,EAAAA,SAAS,CAACI,MAAOT,EAAMS,MAAOC,OAAQV,EAAMS,MAAMH,IAA/EK,EAAUH,EAAA,GAAEI,EAAaJ,EAAA,GAC1BK,EAAsCR,EAAAA,SAAS,CAACI,MAAO,KAAMC,OAAQ,OAApEI,OAAgBC,OAGjBC,EAAgB,CACpBC,WAAY,CAAC,CAAEC,KAAMlB,EAAMiB,cAG7BE,EAAAA,WAAU,WAER,IAEEC,EAAGC,QAAU,SAAUC,GAEM,MAAvBpB,EAAYqB,UACdrB,EAAYqB,QAAQC,UAAYF,EAAMG,QAAQ,GAC9CvB,EAAYqB,QAAQG,OAAQ,EAC5BxB,EAAYqB,QAAQI,SAAW3B,EAAM2B,SACrCzB,EAAYqB,QAAQK,SAAW5B,EAAM4B,SACrC1B,EAAYqB,QAAQM,iBAAiB,SAAS,SAACP,GAC7CnB,EAASoB,SAAU,CACrB,IACArB,EAAYqB,QAAQM,iBA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,UAAU,EACVV,WAAY,gCCtKR,IAAAiF,EAAU,SAAClG,GACf,OAAO6F,EAAAA,sBAACK,EAAO,KAAElG,EAAMmG,MACzB"}
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export interface StanagPlayerProps {
|
|
3
3
|
serverUrl?: string;
|
|
4
|
+
width: number;
|
|
5
|
+
defaultAspectRatio?: number;
|
|
4
6
|
controls?: boolean;
|
|
5
7
|
autoplay?: boolean;
|
|
6
8
|
iceServers?: string;
|
|
7
|
-
onDataReceive?(packetTime: string, klvs: JSON):
|
|
8
|
-
onConnected?(isConnected: boolean):
|
|
9
|
-
onError?(error: string):
|
|
9
|
+
onDataReceive?(packetTime: string, klvs: JSON): void;
|
|
10
|
+
onConnected?(isConnected: boolean): void;
|
|
11
|
+
onError?(error: string): void;
|
|
10
12
|
}
|
|
11
13
|
declare const StanagPlayer: {
|
|
12
14
|
(props: StanagPlayerProps): JSX.Element;
|
|
13
15
|
defaultProps: {
|
|
16
|
+
width: number;
|
|
14
17
|
controls: boolean;
|
|
15
18
|
autoplay: boolean;
|
|
16
19
|
iceServers: string;
|
|
@@ -3,6 +3,7 @@ import { ComponentStory, ComponentMeta } from '@storybook/react';
|
|
|
3
3
|
declare const _default: ComponentMeta<{
|
|
4
4
|
(props: import("./StanagPlayer").StanagPlayerProps): JSX.Element;
|
|
5
5
|
defaultProps: {
|
|
6
|
+
width: number;
|
|
6
7
|
controls: boolean;
|
|
7
8
|
autoplay: boolean;
|
|
8
9
|
iceServers: string;
|
|
@@ -12,6 +13,7 @@ export default _default;
|
|
|
12
13
|
export declare const Player: ComponentStory<{
|
|
13
14
|
(props: import("./StanagPlayer").StanagPlayerProps): JSX.Element;
|
|
14
15
|
defaultProps: {
|
|
16
|
+
width: number;
|
|
15
17
|
controls: boolean;
|
|
16
18
|
autoplay: boolean;
|
|
17
19
|
iceServers: string;
|
package/dist/esm/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e,{useRef as n,useEffect as o}from"react";var
|
|
1
|
+
import e,{useRef as n,useState as t,useEffect as o}from"react";var r=function(r){n(null);var c=n(null),a=n(!0),i=t(16/9),d=i[0],s=i[1],l=t({width:r.width,height:r.width/d}),u=l[0],h=l[1],g=t({width:1920,height:1080}),f=g[0],v=g[1],w={iceServers:[{urls:r.iceServers}]};o((function(){try{p.ontrack=function(e){null!=c.current&&(c.current.srcObject=e.streams[0],c.current.muted=!0,c.current.autoplay=r.autoplay,c.current.controls=r.controls,c.current.addEventListener("pause",(function(e){a.current=!0})),c.current.addEventListener("play",(function(e){a.current=!1})),c.current.addEventListener("loadedmetadata",(function(e){v({width:c.current.videoWidth,height:c.current.videoHeight})})))},p.onconnectionstatechange=function(e){return console.log(p.iceConnectionState)},p.oniceconnectionstatechange=function(e){return console.log(p.iceConnectionState)},p.onicegatheringstatechange=function(e){return console.log(p.iceGatheringState)},p.addTransceiver("video",{direction:"sendrecv"});var e=p.createDataChannel("klv");e.binaryType="arraybuffer",e.onclose=function(){return console.log("dataChannel has closed")},e.onopen=function(){return console.log("dataChannel has opened")},e.onmessage=function(e){if(!a.current){var n=new DataView(e.data),t=new TextDecoder("utf8"),o=JSON.parse(t.decode(n)),c=(o.packetTime,o.klvs);r.onDataReceive&&r.onDataReceive(new Date(c[2]/1e3).toISOString(),c)}};var n=r.serverUrl?r.serverUrl:window.location.origin,t=new URL(n),o="ws";"http:"!=t.protocol&&(o+="s");var i=new WebSocket(o+"://".concat(t.host,"/ws"));i.onmessage=function(e){var n=JSON.parse(e.data);if(!n)return console.log("failed to parse msg");n.candidate?p.addIceCandidate(n):p.setRemoteDescription(n)},i.onerror=function(e){console.log("Websocket Error.")},i.onclose=function(e){r.onConnected&&r.onConnected(!1),1e3!=e.code&&(r.onError&&console.log("Websocket closed: ".concat(e.code)),r.onError("Websocket error: ".concat(e.code)))},p.onicecandidate=function(e){e.candidate&&""!==e.candidate.candidate&&i.send(JSON.stringify(e.candidate))},i.onopen=function(){r.onConnected&&r.onConnected(!0),p.createOffer().then((function(e){p.setLocalDescription(e),i.send(JSON.stringify(e))}))}}catch(e){console.log("Error: ".concat(e.message))}}),[]),o((function(){try{console.log("Video dimensions: ".concat(f.width,"x").concat(f.height));var e=f.width/f.height;s(e),h({width:r.width,height:r.width/e})}catch(e){}}),[f.width,f.height,r.width]);var p=new RTCPeerConnection(w),m={width:u.width,height:u.height};return e.createElement("video",{style:m,ref:c})};r.defaultProps={width:360,controls:!0,autoplay:!0,iceServers:"stun:stun.l.google.com:19302"};var c=function(n){return e.createElement(c,null,n.label)};export{c as KlvView,r as StanagPlayer};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/components/StanagPlayer/StanagPlayer.tsx","../../src/components/KlvView/KlvView.tsx"],"sourcesContent":[null,null],"names":["StanagPlayer","props","
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/components/StanagPlayer/StanagPlayer.tsx","../../src/components/KlvView/KlvView.tsx"],"sourcesContent":[null,null],"names":["StanagPlayer","props","useRef","videoPlayer","isPaused","_a","useState","aspectRatio","setAspectRatio","_b","width","height","playerSize","setPlayerSize","_c","videoDimension","setVideoDimension","configuration","iceServers","urls","useEffect","pc","ontrack","event","current","srcObject","streams","muted","autoplay","controls","addEventListener","videoWidth","videoHeight","onconnectionstatechange","e","console","log","iceConnectionState","oniceconnectionstatechange","onicegatheringstatechange","iceGatheringState","addTransceiver","direction","dataChannel","createDataChannel","binaryType","onclose","onopen","onmessage","dataView","DataView","data","decoder","TextDecoder","JSON","parse","decode","klvs","onDataReceive","Date","toISOString","location_1","serverUrl","window","location","origin","uri","URL","wsProto","protocol","socket_1","WebSocket","concat","host","msg","candidate","addIceCandidate","setRemoteDescription","onerror","onConnected","code","onError","onicecandidate","send","stringify","createOffer","then","offer","setLocalDescription","error","message","curAspectRatio","RTCPeerConnection","playerSt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AM8E,aAAY,GAEpB1D,EAAGgE,cAAcC,MAAK,SAACC,GACrBlE,EAAGmE,oBAAoBD,GACvBjB,EAAOa,KAAK7B,KAAK8B,UAAUG,GAC7B,GACF,CAGD,CAFC,MAAOE,GACPtD,QAAQC,IAAI,UAAAoC,OAAUiB,EAAMC,SAC7B,CAEF,GAAE,IAEHtE,GAAU,WACR,IACEe,QAAQC,IAAI,qBAAAoC,OAAqBzD,EAAeL,MAAK,KAAA8D,OAAIzD,EAAeJ,SACxE,IAAMgF,EAAiB5E,EAAeL,MAAQK,EAAeJ,OAC7DH,EAAemF,GACf9E,EAAc,CAACH,MAAOT,EAAMS,MAAOC,OAAQV,EAAMS,MAAMiF,GAGxD,CAFC,MAAOF,GAER,CACH,GAAE,CAAC1E,EAAeL,MAAOK,EAAeJ,OAAQV,EAAMS,QAGtD,IAAIW,EAAK,IAAIuE,kBAAkB3E,GAEzB4E,EAAc,CACdnF,MAAOE,EAAWF,MAClBC,OAAQC,EAAWD,QAGzB,OAGMmF,EAAAC,cAAA,QAAA,CAAOC,MAAOH,EAAaI,IAAK9F,GAGxC,EAGAH,EAAakG,aAAe,CAC1BxF,MAAO,IACPmB,UAAU,EACVD,UAAU,EACVV,WAAY,gCCtKR,IAAAiF,EAAU,SAAClG,GACf,OAAO6F,gBAACK,EAAO,KAAElG,EAAMmG,MACzB"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
interface StanagPlayerProps {
|
|
3
3
|
serverUrl?: string;
|
|
4
|
+
width: number;
|
|
5
|
+
defaultAspectRatio?: number;
|
|
4
6
|
controls?: boolean;
|
|
5
7
|
autoplay?: boolean;
|
|
6
8
|
iceServers?: string;
|
|
7
|
-
onDataReceive?(packetTime: string, klvs: JSON):
|
|
8
|
-
onConnected?(isConnected: boolean):
|
|
9
|
-
onError?(error: string):
|
|
9
|
+
onDataReceive?(packetTime: string, klvs: JSON): void;
|
|
10
|
+
onConnected?(isConnected: boolean): void;
|
|
11
|
+
onError?(error: string): void;
|
|
10
12
|
}
|
|
11
13
|
declare const StanagPlayer: {
|
|
12
14
|
(props: StanagPlayerProps): JSX.Element;
|
|
13
15
|
defaultProps: {
|
|
16
|
+
width: number;
|
|
14
17
|
controls: boolean;
|
|
15
18
|
autoplay: boolean;
|
|
16
19
|
iceServers: string;
|