UNPKG

clitehd-external-api

Version:

A tiny library for external login to clitehd

2 lines (1 loc) 888 B
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t():"function"==typeof define&&define.amd?define(t):t()}(0,function(){"use strict";module.exports={sayHello:function(){return"Welcome to CliteHD 2.0"},createRoom:function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:"v2.clitehd.com",o=document.createElement("form");o.setAttribute("method","post"),o.setAttribute("action","https://"+n+"/api/externalSignin"),o.setAttribute("target","_blank");var i=document.createElement("input");i.type="hidden",i.name="username",i.value=e,o.appendChild(i);var d=document.createElement("input");d.type="hidden",d.name="password",d.value=t,o.appendChild(d),document.body.appendChild(o),o.submit(),document.body.removeChild(o)},joinRoom:function(e){window.open("https://"+(1<arguments.length&&void 0!==arguments[1]?arguments[1]:"v2.clitehd.com")+"/"+e,"_blank")}}});