Xverse.js 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. class Xverse extends Xverse$1 {
  2. async joinRoom(e) {
  3. const t = e.pathName || "thirdwalk"
  4. , r = e.rotationRenderType || RenderType.RotationVideo
  5. , n = e.person || Person.Third
  6. , o = new XverseRoom(le(oe({}, e), {
  7. appId: e.appId || this.appId,
  8. releaseId: e.releaseId || this.releaseId,
  9. pageSession: this.pageSession,
  10. isAllSync: !0,
  11. rotationRenderType: r,
  12. syncByEvent: !0,
  13. pathName: t,
  14. person: n,
  15. role: e.role || "audience"
  16. }));
  17. return o.initRoom().then(()=>o)
  18. }
  19. }
  20. const log$c = new Logger("xverse")
  21. class Xverse$1{
  22. constructor(e) {
  23. E(this, "debug", !1);
  24. E(this, "pageSession");
  25. E(this, "preload");
  26. E(this, "appId");
  27. E(this, "releaseId");
  28. e || (e = {});
  29. const {onLog: t, env: r, appId: n, releaseId: o, subPackageVersion: a} = e;
  30. ve.NO_CACHE = !1,
  31. ve.env = r || "PROD",
  32. ve.SUB_PACKAGE_VERSION = a,
  33. this.debug && Logger.setLevel(LoggerLevels.Debug);
  34. const s = this.pageSession = uuid$1();
  35. if (reporter.updateHeader({
  36. pageSession: s
  37. }),
  38. reporter.updateReportUrl(REPORT_URL[ve.env]),
  39. a && reporter.updateBody({
  40. sdkVersion: a
  41. }),
  42. log$c.infoAndReportMeasurement({
  43. metric: "sdkInit",
  44. startTime: Date.now(),
  45. extra: {
  46. version: a,
  47. enviroment: r,
  48. pageSession: s
  49. }
  50. }),
  51. log$c.debug("debug mode:", this.debug),
  52. reporter.on("report", l=>{
  53. t && t(l)
  54. }
  55. ),
  56. n) {
  57. this.appId = n,
  58. this.releaseId = o;
  59. const l = ModelManager.getInstance(n, o);
  60. this.preload = new Preload(l)
  61. }
  62. }
  63. get isSupported() {
  64. return isSupported()
  65. }
  66. disableLogUpload() {
  67. reporter.disable(),
  68. log$c.debug("log upload has been disabled")
  69. }
  70. async getSkinList() {
  71. return []
  72. }
  73. async getAvatarList() {
  74. return []
  75. }
  76. async getGiftList() {
  77. return [{
  78. id: "hack "
  79. }]
  80. }
  81. }
  82. ;
  83. E(Xverse$1, "NO_CACHE"),
  84. E(Xverse$1, "USE_TME_CDN"),
  85. E(Xverse$1, "env"),
  86. E(Xverse$1, "SUB_PACKAGE_VERSION");