diff --git a/README.md b/README.md index d0ae7c8..399ea79 100644 --- a/README.md +++ b/README.md @@ -144,6 +144,26 @@ iceTransportPolicy: "all"//for option "relay" need use turn server full list of config you can see on [RTCPeerConnection](https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/RTCPeerConnection#parameters) +#### `onWsClose` +default: null; + +handle websocket close event + +example: +```js +onWsClose: (code, reason)=>{ + switch (code){ + case 1000: + case 1006: + //reconect to socket + player.load(source); + break; + default: + player.destroy(); + } +} +``` + ## Methods #### `load(source)`