您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

class_dec.js 6.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. GLOB_ORIG = "glob_orig_v2"
  2. function FS_dec_proto_v2(fn,fn_name) {
  3. return function() {
  4. clog("fdp0",fn_name,glob_react.Filmstrip._getThumbs())
  5. dec_fns[fn_name] && dec_fns[fn_name].pre ? dec_fns[fn_name].pre({that:this, arguments}) : 1
  6. if (fn_name == "updateDOMLocation") {
  7. this.updateDOMLocation2()
  8. }
  9. const ret = fn.apply(this, arguments);
  10. // console.log('FSD',fn_name,ret, [this,...arguments]);
  11. // console.log('FSD',fn_name);
  12. // console.trace('FSD_trc '+fn_name);
  13. // log_tb()
  14. // window.log_tb(new Error(),fn_name)
  15. // clog("rtscv1",glob_react.Filmstrip._getThumbs())
  16. // resizeThumbnailsForCustomView(this,fn_name,arguments)
  17. clog("fdp2",fn_name,glob_react.Filmstrip._getThumbs())
  18. const ret2 = dec_fns[fn_name] && dec_fns[fn_name].post ? dec_fns[fn_name].post({that:this, arguments}) : 0
  19. if (ret2){
  20. return ret2.ret
  21. }
  22. // const result = fn.apply(this, arguments);
  23. // console.log('Finished');
  24. // clog("rtscv2",glob_react.Filmstrip._getThumbs())
  25. return ret;
  26. }
  27. }
  28. function undec_class_v2(cls,cls_orig,cname){
  29. var k,v
  30. var proto = cls_orig
  31. // var proto = glob_react.vidClass.LocalVideo.prototype
  32. // for ([k,v] of iter_desc(proto)){
  33. for ([k,v] of Object.entries(proto)){
  34. // glob_react.Filmstrip[k] = v
  35. // clog(k,v)
  36. cls.prototype[k] = v.value
  37. // clog(k,v)
  38. }
  39. }
  40. function _method_dec_v2(fn,fn_name){
  41. return function() {
  42. // clog("fdp0",fn_name,glob_react.Filmstrip._getThumbs())
  43. const ret1 = dec_fns[fn_name] && dec_fns[fn_name].pre ? dec_fns[fn_name].pre({that:this, args:arguments}) : 0
  44. // if (fn_name == "updateDOMLocation") {
  45. // this.updateDOMLocation2()
  46. // }
  47. if (ret1){
  48. return ret1.ret
  49. }
  50. const ret = fn.apply(this, arguments);
  51. // clog("MDV2",fn_name,{that:this, args:arguments,ret:ret})
  52. // clog("MDV2 xyz",fn_name,{that:this, args:arguments,ret:ret})
  53. // console.log('FSD',fn_name,ret, [this,...arguments]);
  54. // console.log('FSD',fn_name);
  55. // console.trace('FSD_trc '+fn_name);
  56. // log_tb()
  57. // window.log_tb(new Error(),fn_name)
  58. // clog("rtscv1",glob_react.Filmstrip._getThumbs())
  59. // resizeThumbnailsForCustomView(this,fn_name,arguments)
  60. // clog("fdp2",fn_name,glob_react.Filmstrip._getThumbs())
  61. const ret2 = dec_fns[fn_name] && dec_fns[fn_name].post ? dec_fns[fn_name].post({that:this, arguments}) : 0
  62. // clog("MDEX",{ret1,ret2})
  63. if (ret2){
  64. return ret2.ret
  65. }
  66. // const result = fn.apply(this, arguments);
  67. // console.log('Finished');
  68. // clog("rtscv2",glob_react.Filmstrip._getThumbs())
  69. return ret;
  70. }
  71. }
  72. function dec_class_v2(cls,cls_orig,cname){
  73. var k,v
  74. var proto = cls_orig
  75. // var proto = glob_react.vidClass.LocalVideo.prototype
  76. // for ([k,v] of iter_desc(proto)){
  77. for ([k,v] of Object.entries(proto)){
  78. // glob_react.Filmstrip[k] = v
  79. // clog(k,v)
  80. cls.prototype[k] = _method_dec_v2(v.value,k)
  81. // clog(k,v)
  82. }
  83. }
  84. function save_orig_class(cls){
  85. var i,k,v
  86. var i2,k2,v2
  87. var o
  88. var ret = {}
  89. // o = glob_react.vidClass.LocalVideo.prototype
  90. // o = tobj
  91. // o = glob_react.vidClass.LocalVideo
  92. // for ([k,v] of Object.entries(glob_react.vidClass)){
  93. // for ([k,v] of Object.entries(o)){
  94. // for ([k2,v2] of Object.entries(glob_react.vidClass)){
  95. // for ([k2,v2] of Object.entries(classes)){
  96. // clog("...",k2)
  97. // ret[k2] = {}
  98. o = cls.prototype
  99. for ([k,v] of iter_desc(o)){
  100. // clog(k,v)
  101. ret[k]=v
  102. // clog(k2,k,v)
  103. }
  104. // }
  105. // clog("><",Object.getOwnPropertyDescriptors(o))
  106. return ret
  107. }
  108. // dec_fns
  109. function init_cdec(){
  110. let runonce = !window[GLOB_ORIG]
  111. // runonce = 1
  112. // if (!window[GLOB_ORIG]){
  113. // }
  114. window[GLOB_ORIG] = window[GLOB_ORIG] || {
  115. classes:{}
  116. }
  117. cdec.glob_orig = window[GLOB_ORIG]
  118. if (runonce){
  119. window[GLOB_ORIG].classes["SharedVideoManager"] = cdec.get_class_methods(glob_react.SharedVideoManager)
  120. }
  121. }
  122. function undec_svm(){
  123. cdec.undec_class(glob_react.SharedVideoManager,cdec.glob_orig.classes.SharedVideoManager)
  124. }
  125. function dec_svm(){
  126. cdec.dec_class(glob_react.SharedVideoManager,cdec.glob_orig.classes.SharedVideoManager)
  127. }
  128. // function dec_svm(){}
  129. function onSharedVideoUpdate_mod(id, url, attributes) {
  130. // if we are sending the event ignore
  131. if (APP.conference.isLocalId(this.from)) {
  132. return;
  133. }
  134. if (!this.isSharedVideoShown) {
  135. this.onSharedVideoStart(id, url, attributes);
  136. return;
  137. }
  138. // eslint-disable-next-line no-negated-condition
  139. if (!this.player) {
  140. this.initialAttributes = attributes;
  141. } else {
  142. this.processVideoUpdate(this.player, attributes);
  143. }
  144. }
  145. dec_fns_v2 = {
  146. onSharedVideoUpdate:{
  147. pre(o){
  148. try {
  149. if (!o.that.player){
  150. window.autoplay_probably_disabled ? autoplay_probably_disabled(o) : clog("NO fix implemented")
  151. clog("...autoplay_probably_disabled...")
  152. }
  153. /*
  154. clog("onSharedVideoUpdate pre arg",[...o.args])
  155. // clog("onSharedVideoUpdate pre",o.args[2],o.that.isSharedVideoShown,!this.player)
  156. clog("onSharedVideoUpdate pre",o.args[2],!o.that.isSharedVideoShown,!o.that.player)
  157. // onSharedVideoUpdate_mod.apply(o.that, o.args);
  158. try {
  159. clog("osvu player",o.that.player)
  160. o.that.player.g.g.playerVars
  161. } catch (err){
  162. clog("osvu err")
  163. }
  164. clog("onSharedVideoUpdate...",o.that.player)
  165. */
  166. // return {}
  167. } catch (err){clog("dec fn err svm",err)}
  168. // return onSharedVideoUpdate_mod.apply(o.that, o.args);
  169. // return onSharedVideoUpdate_mod.apply(o.that, o.args);
  170. },
  171. post_x(o){
  172. try {
  173. // clog("onSharedVideoUpdate post",o)
  174. } catch (err){clog("dec fn err svm")}
  175. },
  176. }
  177. }
  178. cdec = {
  179. get_class_methods:save_orig_class,
  180. undec_class:undec_class_v2,
  181. dec_class:dec_class_v2,
  182. glob_orig:window[GLOB_ORIG],
  183. }
  184. dec_fns = window.dec_fns || {}
  185. Object.assign(dec_fns,dec_fns_v2)
  186. init_cdec()
  187. dec_svm()