123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202 |
-
- window.glob_dev_fns.conInc_render_icon = function (o,name,a3) {
- // body...
- // that.props.connectionStatus == "inactive"
-
- // clog("coninc render",o,name,a3)
- // clog("coninc render",o.that.props.connectionStatus,o.that.props.participantId,o,name)
- }
-
-
-
-
-
-
- function pleft(o){
- // clog("pleft",o,get_participants())
- discard_participant(o)
-
- discard_smallvid(o.action.participant.id)
- // clog("pleft",o,get_participants(),Object.keys(msto.participants) )
- // prune_smallvids()
- }
- function pjoin(o){
- add_participant(o)
- clog("pjoin",o,get_participants())
- }
- function deep_prop_v2(o,p){
- try {
- var arr = jc(p)
- var ret = o
- var retm = {}
- var key
- retm.arr = arr
- retm.arr0 = p
-
- while (arr.length){
- // clog("deep_prop",arr,ret)
- key = arr.shift()
- if (!arr.length){
- retm.v_exist = key in ret
- }
-
- ret = ret[key]
- retm.v = ret
-
- }
- // clog("deep_prop ret",ret)
- // return retm
- } catch(err){
- retm.err=err
- retm.key=key
- // console.error("DEEP_PROP ERR:",err)
- }
- return retm
- }
-
-
-
-
-
-
- function smallvid_filter_0(elm){
- var s = this
- // clog("smallvids filter",this,[...arguments])
- // clog("smallvids filter",s == "ID",s+"" == "ID",this,[...arguments])
- // clog("GLVCB",this,[...arguments])
- try{
- // return elm.isLocal
- return elm.id != this
-
- } catch{}
- }
-
- function discard_smallvid(id){
- var smallvids = glob_dev_hooks.smallvids.filter(smallvid_filter_0,id)
- glob_dev_hooks.smallvids = smallvids
-
- }
- function smallvid_filter(elm){
- // var s = this
- // clog("~",elm,elm.id)
- // clog("smallvids filter",this,[...arguments])
- // clog("smallvids filter",s == "ID",s+"" == "ID",this,[...arguments])
- // clog("GLVCB",this,[...arguments])
- try{
- // return elm.isLocal
- // return elm.id != this
- return this.includes(elm.id)
-
- } catch{}
- }
-
-
- function get_ids(){
- // clog("")
- var ret = []
- var p = get_participants()
- for (k of p){
- ret.push(k.id)
- // clog("~",k)
- }
- return ret
- // clog("~2",ret)
- }
-
- function prune_smallvids(){
- // var smallvids = get_participants().filter(smallvid_filter,Object.keys(msto.participants))
- var smallvids = glob_dev_hooks.smallvids.filter(smallvid_filter,get_ids())
-
- // clog(smallvids,glob_dev_hooks.smallvids)
- glob_dev_hooks.smallvids = smallvids
-
- }
-
- // function
-
-
-
-
-
-
-
-
-
-
-
- function coninc_conection_event(o){
-
- // clog("PARTICIPANT_UPDATED",o,get_participants())
- // "action.participant.connectionStatus".split(".")
-
- // clog("PARTICIPANT_UPDATED",o,get_participants())
- if (o.action && o.action.participant && o.action.participant.connectionStatus){
-
- }
- var ret = deep_prop_v2(o,"action.participant.connectionStatus".split("."))
- if (ret.v_exist){
- clog("conic +",ret,o)
-
- } else {
- clog("conic !",ret,o)
- // clog(ret)
- }
- // clog("PARTICIPANT_UPDATED",o)
- }
- function discard_participant(o){
- // o.action.participant.id
- delete window.glob_mx.participants[o.action.participant.id]
- }
- function add_participant(o){
- // o.action.participant.id
- if (o.action.participant.id == undefined || o.action.participant.id == "local"){
- return
- }
- window.glob_mx.participants[o.action.participant.id] = undefined
- }
-
-
- function conf_joined(){
- clog("conf_joined",{participants:get_participants(),smallvids:glob_dev_hooks.smallvids})
- }
-
- function init_participants_obj(){
- var i,k,j,v
- var sf,pf,merged,participants
- merged = {}
- var participants = participants_info()
- for ([k,v] of Object.entries(participants.sf)){
- merged[k]=v["_connectionStatus"] || participants.pf[k].connectionStatus
- // m2.push(v)
- // m2.push(k)
- }
- Object.assign(window.glob_mx.participants,merged)
- return {merged,participants}
-
- }
-
-
- // PARTICIPANT_JOINED
- // PARTICIPANT_LEFT
- // glob_mx.qxi_cb
- window.glob_mx.qxi_cb.PARTICIPANT_UPDATED = window.glob_mx.qxi_cb.PARTICIPANT_UPDATED || {}
- window.glob_mx.participants = window.glob_mx.participants || {}
-
- window.glob_mx.qxi_cb.PARTICIPANT_LEFT = window.glob_mx.qxi_cb.PARTICIPANT_LEFT || {}
- window.glob_mx.qxi_cb.CONFERENCE_JOINED = window.glob_mx.qxi_cb.CONFERENCE_JOINED || {}
- window.glob_mx.qxi_cb.PARTICIPANT_JOINED = window.glob_mx.qxi_cb.PARTICIPANT_JOINED || {}
- glob_mx.qxi_cb.PARTICIPANT_UPDATED.coninc_conection_event = coninc_conection_event
- glob_mx.qxi_cb.PARTICIPANT_LEFT.pleft = pleft
-
- glob_mx.qxi_cb.PARTICIPANT_JOINED.pjoin = pjoin
- glob_mx.qxi_cb.CONFERENCE_JOINED.conf_joined = conf_joined
-
- clog("CONINC js")
-
-
- function get_coninc_status(){
- clog("CON_INC",get_participants())
- }
- // get_coninc_status()
- // exp_api_dbg("CON_INC")
- // clog("CON_INC",{})
|