tuikit-atomicx-vue3 3.4.2 → 3.5.0-beta.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (498) hide show
  1. package/.eslintrc.cjs +1 -0
  2. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-D1G-LitO.js → MessageInput.vue_vue_type_script_setup_true_lang-jPzZ5INK.js} +38 -36
  3. package/dist/{PopoverTrigger-L8abAry7.js → PopoverTrigger-CglNN8IV.js} +3 -3
  4. package/dist/{PopperContent-XdhqL8Y2.js → PopperContent-CQa08BXt.js} +1 -1
  5. package/dist/{Teleport-CSEuZbpM.js → Teleport-D3gvcBbZ.js} +278 -268
  6. package/dist/baseComp/Modal/Modal.js +431 -23
  7. package/dist/chat/index.d.ts +68 -53
  8. package/dist/chat/server.js +15 -15
  9. package/dist/components/AudioSetting/AudioMediaControl.js +39 -41
  10. package/dist/components/AudioSetting/AudioSettingTab.js +10 -10
  11. package/dist/components/AudioSetting/MicrophoneSelect.js +8 -8
  12. package/dist/components/AudioSetting/SpeakerSelect.js +9 -9
  13. package/dist/components/AudioSettingPanel/i18n/en-US/index.d.ts +1 -0
  14. package/dist/components/AudioSettingPanel/i18n/en-US/index.js +2 -1
  15. package/dist/components/AudioSettingPanel/i18n/zh-CN/index.d.ts +1 -0
  16. package/dist/components/AudioSettingPanel/i18n/zh-CN/index.js +2 -1
  17. package/dist/components/AudioSettingPanel/index.js +81 -73
  18. package/dist/components/BarrageInput/BarrageInputH5.js +9 -9
  19. package/dist/components/BarrageInput/EmojiPicker/EmojiPicker.js +4 -4
  20. package/dist/components/BarrageInput/MessageInputState.d.ts +28 -0
  21. package/dist/components/BarrageInput/MessageInputState.js +82 -0
  22. package/dist/components/BarrageInput/TextEditor/CharacterCountExtension.js +1 -1
  23. package/dist/components/BarrageInput/TextEditor/EditorCore.js +5 -4
  24. package/dist/components/BarrageInput/TextEditor/index.js +7 -7
  25. package/dist/components/BarrageInput/type.d.ts +17 -0
  26. package/dist/components/BarrageInput/type.js +4 -0
  27. package/dist/components/BarrageInput/utils.d.ts +30 -0
  28. package/dist/components/BarrageInput/utils.js +41 -0
  29. package/dist/components/BarrageList/BarrageList.js +80 -110
  30. package/dist/components/BarrageList/BarrageList.vue.d.ts +0 -29
  31. package/dist/components/BarrageList/BarrageListH5.js +95 -122
  32. package/dist/components/BarrageList/BarrageListH5.vue.d.ts +0 -29
  33. package/dist/components/BarrageList/BarrageListState.d.ts +58 -0
  34. package/dist/components/BarrageList/BarrageListState.js +106 -0
  35. package/dist/components/BarrageList/Message/MessageLayout/MessageBubble/MessageBubble.js +16 -24
  36. package/dist/components/BarrageList/Message/MessageLayout/MessageBubble/MessageBubble.vue.d.ts +5 -5
  37. package/dist/components/BarrageList/Message/MessageLayout/MessageLayout.js +48 -73
  38. package/dist/components/BarrageList/Message/MessageLayout/MessageLayout.vue.d.ts +5 -7
  39. package/dist/components/BarrageList/Message/TextMessage/TextMessage.js +70 -76
  40. package/dist/components/BarrageList/Message/TextMessage/TextMessage.vue.d.ts +6 -6
  41. package/dist/components/BarrageList/Message/TextMessage/emoji.d.ts +5 -0
  42. package/dist/components/BarrageList/Message/TextMessage/emoji.js +134 -0
  43. package/dist/components/BarrageList/index.d.ts +0 -36
  44. package/dist/components/CameraButton/index.js +18 -19
  45. package/dist/components/ChatSetting/GroupChatSetting/GroupChatSetting.js +2 -1
  46. package/dist/components/CoGuestPanel/CoGuestPanel.js +60 -60
  47. package/dist/components/CoHostPanel/BattlePanel.js +11 -11
  48. package/dist/components/CoHostPanel/CoHostPanel.js +10 -10
  49. package/dist/components/CoHostPanel/ConfigSettingPanel.js +49 -55
  50. package/dist/components/CoHostPanel/ConnectionPanel.js +132 -123
  51. package/dist/components/CoHostPanel/RecommendHostList.js +39 -36
  52. package/dist/components/CoHostPanel/constants.d.ts +3 -0
  53. package/dist/components/CoHostPanel/constants.js +6 -0
  54. package/dist/components/CoHostPanel/i18n/en-US/index.d.ts +1 -0
  55. package/dist/components/CoHostPanel/i18n/en-US/index.js +2 -1
  56. package/dist/components/CoHostPanel/i18n/zh-CN/index.d.ts +1 -0
  57. package/dist/components/CoHostPanel/i18n/zh-CN/index.js +3 -2
  58. package/dist/components/ContactList/ContactInfo/BlacklistInfo/BlacklistInfo.js +6 -6
  59. package/dist/components/ContactList/ContactInfo/ContactInfo.js +1 -1
  60. package/dist/components/ContactList/ContactInfo/FriendApplicationInfo/FriendApplicationInfo.js +1 -1
  61. package/dist/components/ContactList/ContactInfo/FriendInfo/FriendInfo.js +9 -9
  62. package/dist/components/ContactList/ContactInfo/GroupApplicationInfo/GroupApplicationInfo.js +1 -1
  63. package/dist/components/ContactList/ContactInfo/GroupInfo/GroupInfo.js +4 -4
  64. package/dist/components/ContactList/ContactInfo/SearchGroupInfo/SearchGroupInfo.js +8 -8
  65. package/dist/components/ContactList/ContactInfo/SearchUserInfo/SearchUserInfo.js +7 -7
  66. package/dist/components/ContactList/ContactList.js +7 -7
  67. package/dist/components/ContactList/ContactListItem/BlacklistItem/BlacklistItem.js +8 -8
  68. package/dist/components/ContactList/ContactListItem/FriendApplicationItem/FriendApplicationItem.js +5 -5
  69. package/dist/components/ContactList/ContactListItem/FriendItem/FriendItem.js +5 -5
  70. package/dist/components/ContactList/ContactListItem/GroupApplicationItem/GroupApplicationItem.js +1 -1
  71. package/dist/components/ContactList/ContactListItem/GroupItem/GroupItem.js +1 -1
  72. package/dist/components/ContactList/ContactSearch/ContactSearch.js +6 -6
  73. package/dist/components/ConversationList/ConversationActions/ConversationActions.js +49 -51
  74. package/dist/components/ConversationList/ConversationCreate/ConversationCreate.js +9 -9
  75. package/dist/components/ConversationList/ConversationList.js +4 -4
  76. package/dist/components/ConversationList/ConversationList.vue.d.ts +10 -10
  77. package/dist/components/ConversationList/ConversationPreview/ConversationPreview.vue.d.ts +10 -10
  78. package/dist/components/ConversationList/ConversationPreview/ConversationPreviewTimestamp.js +31 -29
  79. package/dist/components/ConversationList/ConversationPreview/ConversationPreviewUI.js +20 -20
  80. package/dist/components/ConversationList/ConversationPreview/ConversationPreviewUI.vue.d.ts +2 -2
  81. package/dist/components/ConversationList/ConversationPreview/index.js +1 -1
  82. package/dist/components/ConversationList/index.d.ts +30 -30
  83. package/dist/components/LiveAudienceList/LiveAudienceList.js +44 -45
  84. package/dist/components/LiveAudienceList/LiveAudienceListH5.js +7 -7
  85. package/dist/components/LiveAudienceList/UserActionMenu.js +57 -64
  86. package/dist/components/LiveList/LiveList.js +23 -23
  87. package/dist/components/LiveList/LiveListH5.js +38 -38
  88. package/dist/components/LiveScenePanel/CameraSettingDialog.js +10 -10
  89. package/dist/components/LiveScenePanel/MaterialItem.js +15 -15
  90. package/dist/components/LiveScenePanel/index.js +28 -27
  91. package/dist/components/LiveView/CoreViewDecorate/BattleDecorate.js +58 -58
  92. package/dist/components/LiveView/CoreViewDecorate/BattleUserDecorate.js +6 -6
  93. package/dist/components/LiveView/CoreViewDecorate/CoHostDecorate.js +5 -5
  94. package/dist/components/LiveView/DefaultStreamViewUI.js +44 -41
  95. package/dist/components/LiveView/PlayerControl/AudioControl.js +97 -93
  96. package/dist/components/LiveView/PlayerControl/AudioControl.vue.d.ts +10 -6
  97. package/dist/components/LiveView/PlayerControl/MultiResolution.js +57 -62
  98. package/dist/components/LiveView/PlayerControl/PlayerControl.js +79 -79
  99. package/dist/components/LiveView/PlayerControl/PlayerControlState.d.ts +2 -2
  100. package/dist/components/LiveView/PlayerControl/PlayerControlState.js +164 -209
  101. package/dist/components/LiveView/PlayerControl/utils/domHelpers.d.ts +8 -1
  102. package/dist/components/LiveView/PlayerControl/utils/domHelpers.js +57 -24
  103. package/dist/components/LiveView/i18n/en-US/index.d.ts +2 -2
  104. package/dist/components/LiveView/i18n/en-US/index.js +2 -2
  105. package/dist/components/LiveView/i18n/zh-CN/index.d.ts +2 -2
  106. package/dist/components/LiveView/i18n/zh-CN/index.js +2 -2
  107. package/dist/components/LiveView/index.js +17 -17
  108. package/dist/components/MessageInput/AttachmentPicker/index.js +1 -1
  109. package/dist/components/MessageInput/AudioCallPicker/AudioCallPicker.js +63 -65
  110. package/dist/components/MessageInput/EmojiPicker/EmojiPicker.js +88 -84
  111. package/dist/components/MessageInput/MessageInput.js +1 -1
  112. package/dist/components/MessageInput/MessageInput.vue.d.ts +5 -2
  113. package/dist/components/MessageInput/TextEditor/EditorCore.d.ts +3 -1
  114. package/dist/components/MessageInput/TextEditor/EditorCore.js +51 -63
  115. package/dist/components/MessageInput/TextEditor/TextEditor.vue.d.ts +6 -2
  116. package/dist/components/MessageInput/TextEditor/extensions/characterCountExtension.d.ts +19 -0
  117. package/dist/components/MessageInput/TextEditor/extensions/characterCountExtension.js +74 -0
  118. package/dist/components/MessageInput/TextEditor/extensions/imageExtension.d.ts +2 -0
  119. package/dist/components/MessageInput/TextEditor/extensions/imageExtension.js +62 -0
  120. package/dist/components/MessageInput/TextEditor/index.js +45 -35
  121. package/dist/components/MessageInput/VideoCallPicker/VideoCallPicker.js +67 -69
  122. package/dist/components/MessageInput/i18n/index.d.ts +4 -0
  123. package/dist/components/MessageInput/i18n/zh-CN.d.ts +4 -0
  124. package/dist/components/MessageInput/i18n/zh-CN.js +5 -1
  125. package/dist/components/MessageInput/index.d.ts +36 -6
  126. package/dist/components/MessageInput/index.js +1 -1
  127. package/dist/components/MessageList/Message/AudioMessage/WaveForm.js +24 -34
  128. package/dist/components/MessageList/Message/CustomMessage/CallMessage/CallMessage.js +29 -28
  129. package/dist/components/MessageList/Message/GroupTipMessage/index.js +13 -13
  130. package/dist/components/MessageList/Message/Message.vue.d.ts +1 -1
  131. package/dist/components/MessageList/Message/MessageLayout/MessageActionDropdown/MessageActionDropdown.js +3 -3
  132. package/dist/components/MessageList/Message/MessageLayout/MessageLayout.js +63 -69
  133. package/dist/components/MessageList/Message/VideoMessage/VideoMessage.js +48 -53
  134. package/dist/components/MessageList/Message/VideoMessage/VideoMessage.vue.d.ts +8 -8
  135. package/dist/components/MessageList/MessageList.js +8 -6
  136. package/dist/components/MessageList/MessageList.vue.d.ts +2 -2
  137. package/dist/components/MessageList/i18n/en-US.d.ts +65 -1
  138. package/dist/components/MessageList/i18n/en-US.js +66 -2
  139. package/dist/components/MessageList/i18n/index.d.ts +128 -0
  140. package/dist/components/MessageList/i18n/index.js +6 -6
  141. package/dist/components/MessageList/i18n/zh-CN.d.ts +65 -1
  142. package/dist/components/MessageList/i18n/zh-CN.js +64 -0
  143. package/dist/components/MessageList/index.d.ts +20 -20
  144. package/dist/components/MicButton/index.js +11 -11
  145. package/dist/components/Search/SearchAdvanced/DateRangePicker/DateRangePicker.js +172 -174
  146. package/dist/components/Search/SearchAdvanced/MessageAdvanced/MessageAdvanced.js +58 -60
  147. package/dist/components/Search/SearchAdvanced/SearchAdvanced.js +28 -30
  148. package/dist/components/Search/SearchAdvanced/SearchTab/SearchTab.js +22 -24
  149. package/dist/components/Search/SearchAdvanced/Slider/Slider.js +26 -28
  150. package/dist/components/Search/SearchAdvanced/UserAdvanced/UserAdvanced.js +133 -135
  151. package/dist/components/Search/SearchBar/SearchBar.js +56 -58
  152. package/dist/components/StreamMixer/LocalMixer/MixerControl.js +12 -12
  153. package/dist/components/StreamMixer/LocalMixer/index.js +66 -63
  154. package/dist/components/StreamView/Layout/CustomLayout.js +8 -8
  155. package/dist/components/StreamView/Layout/FloatLayout.js +124 -127
  156. package/dist/components/StreamView/Layout/GridLayout.js +5 -5
  157. package/dist/components/StreamView/index.js +25 -33
  158. package/dist/components/StreamView/manager/mediaManager.js +54 -60
  159. package/dist/components/UIKitModal/UIKitModal.d.ts +7 -0
  160. package/dist/components/UIKitModal/UIKitModal.js +156 -0
  161. package/dist/components/UIKitModal/index.d.ts +1 -0
  162. package/dist/components/UIKitModal/index.js +4 -0
  163. package/dist/components/{BarrageList/Message/FaceMessage/FaceMessage.vue.d.ts → UIKitModal/index.vue.d.ts} +24 -9
  164. package/dist/components/UIKitModal/type.d.ts +21 -0
  165. package/dist/components/UIKitModal/type.js +1 -0
  166. package/dist/components/UserPicker/UserPicker.js +1 -2
  167. package/dist/components/UserPicker/components/SelectedPanel/SelectedPanel.js +19 -18
  168. package/dist/components/UserPicker/hooks/useSearchFilter.d.ts +2 -2
  169. package/dist/components/UserPicker/hooks/useSearchFilter.js +39 -31
  170. package/dist/components/UserPicker/i18n/en-US.d.ts +1 -0
  171. package/dist/components/UserPicker/i18n/en-US.js +2 -1
  172. package/dist/components/UserPicker/i18n/index.d.ts +2 -0
  173. package/dist/components/UserPicker/i18n/zh-CN.d.ts +1 -0
  174. package/dist/components/UserPicker/i18n/zh-CN.js +2 -1
  175. package/dist/components/UserPicker/index.d.ts +2 -2
  176. package/dist/components/UserPicker/type.d.ts +1 -1
  177. package/dist/components/VideoSetting/CameraSelect.js +8 -8
  178. package/dist/components/VideoSetting/VideoMediaControl.js +10 -10
  179. package/dist/components/VideoSetting/VideoPreview.js +9 -9
  180. package/dist/components/VideoSetting/VideoProfile.js +6 -6
  181. package/dist/components/VideoSetting/VideoSettingTab.js +40 -39
  182. package/dist/components/VideoSettingPanel/CameraSelect.js +8 -8
  183. package/dist/components/VideoSettingPanel/VideoPreview.js +1 -1
  184. package/dist/components/VideoSettingPanel/VideoProfile.js +18 -18
  185. package/dist/hooks/useAudioControl.d.ts +3 -3
  186. package/dist/hooks/useAudioControl.js +32 -30
  187. package/dist/hooks/useRoomEngine.js +6 -6
  188. package/dist/index-B_-9wgM4.js +64 -0
  189. package/dist/{index-Bm-QfV5o.js → index-DMfTuy0v.js} +574 -631
  190. package/dist/{index-D2OVtqc8.js → index-DV6o6s43.js} +946 -915
  191. package/dist/index.d.ts +3 -1
  192. package/dist/index.js +164 -142
  193. package/dist/report/MetricsKey.d.ts +16 -0
  194. package/dist/report/MetricsKey.js +4 -0
  195. package/dist/report/dataReport.d.ts +12 -0
  196. package/dist/report/dataReport.js +45 -0
  197. package/dist/report/index.d.ts +4 -0
  198. package/dist/report/index.js +6 -0
  199. package/dist/rtc/index.d.ts +5 -43
  200. package/dist/rtc/index.js +48 -48
  201. package/dist/rtc/server.js +45 -40
  202. package/dist/states/BarrageState/BarrageState.d.ts +74 -0
  203. package/dist/states/BarrageState/BarrageState.js +80 -0
  204. package/dist/states/BarrageState/index.d.ts +1 -0
  205. package/dist/states/BarrageState/index.js +5 -0
  206. package/dist/states/{BattleState.d.ts → BattleState/BattleState.d.ts} +10 -11
  207. package/dist/states/BattleState/BattleState.js +203 -0
  208. package/dist/states/BattleState/index.d.ts +1 -0
  209. package/dist/states/BattleState/index.js +4 -0
  210. package/dist/states/CoGuestState.d.ts +24 -94
  211. package/dist/states/CoGuestState.js +297 -189
  212. package/dist/states/CoHostState/CoHostState.d.ts +2 -2
  213. package/dist/states/CoHostState/CoHostState.js +135 -131
  214. package/dist/states/{DeviceState.d.ts → DeviceState/DeviceState.d.ts} +25 -13
  215. package/dist/states/DeviceState/DeviceState.js +314 -0
  216. package/dist/states/DeviceState/index.d.ts +1 -0
  217. package/dist/states/DeviceState/index.js +4 -0
  218. package/dist/states/LiveAudienceState.d.ts +3 -1
  219. package/dist/states/LiveAudienceState.js +106 -63
  220. package/dist/states/{LiveState/index.d.ts → LiveListState/LiveListState.d.ts} +13 -8
  221. package/dist/states/LiveListState/LiveListState.js +285 -0
  222. package/dist/states/LiveListState/index.d.ts +1 -0
  223. package/dist/states/LiveListState/index.js +4 -0
  224. package/dist/states/LiveMonitorState/api/http.js +147 -129
  225. package/dist/states/LiveMonitorState/index.js +67 -62
  226. package/dist/states/LiveMonitorState/player/adapters/trtc.js +6 -6
  227. package/dist/states/LiveSeatState/index.d.ts +46 -11
  228. package/dist/states/LiveSeatState/index.js +34 -15
  229. package/dist/states/LiveSeatState/seatEventManager.d.ts +2 -0
  230. package/dist/states/LiveSeatState/seatEventManager.js +63 -42
  231. package/dist/states/LiveSeatState/seatManager.d.ts +34 -5
  232. package/dist/states/LiveSeatState/seatManager.js +131 -29
  233. package/dist/states/LiveSeatState/store.d.ts +5 -5
  234. package/dist/states/LiveSeatState/store.js +12 -10
  235. package/dist/states/LiveSeatState/usePlayStream/RTCStreamManager.js +1 -1
  236. package/dist/states/LiveSeatState/usePlayStream/RTCStreamPlayer.js +1 -1
  237. package/dist/states/LiveSeatState/usePlayStream/index.js +30 -28
  238. package/dist/states/LoginState.d.ts +23 -0
  239. package/dist/states/MessageInputState/MessageInputState.d.ts +41 -7
  240. package/dist/states/MessageInputState/MessageInputState.js +60 -59
  241. package/dist/states/MessageInputState/utils.d.ts +8 -1
  242. package/dist/states/MessageInputState/utils.js +30 -10
  243. package/dist/states/SeatStore.js +82 -83
  244. package/dist/states/UIKitModalState/UIKitModalState.d.ts +17 -0
  245. package/dist/states/UIKitModalState/UIKitModalState.js +63 -0
  246. package/dist/states/UIKitModalState/index.d.ts +1 -0
  247. package/dist/states/UIKitModalState/index.js +4 -0
  248. package/dist/states/{VideoMixerState.d.ts → VideoMixerState/VideoMixerState.d.ts} +1 -1
  249. package/dist/states/VideoMixerState/VideoMixerState.js +269 -0
  250. package/dist/states/VideoMixerState/index.d.ts +1 -0
  251. package/dist/states/VideoMixerState/index.js +4 -0
  252. package/dist/styles/index.css +1 -1
  253. package/dist/types/audience.d.ts +21 -0
  254. package/dist/types/audience.js +4 -1
  255. package/dist/types/battle.d.ts +75 -3
  256. package/dist/types/battle.js +5 -1
  257. package/dist/types/coGuest.d.ts +72 -5
  258. package/dist/types/coGuest.js +4 -2
  259. package/dist/types/device.d.ts +38 -17
  260. package/dist/types/device.js +10 -8
  261. package/dist/types/index.d.ts +2 -2
  262. package/dist/types/index.js +96 -80
  263. package/dist/types/live.d.ts +36 -21
  264. package/dist/types/live.js +6 -4
  265. package/dist/types/seat.d.ts +23 -4
  266. package/dist/types/seat.js +7 -1
  267. package/dist/{useId-CtirfF0W.js → useId-oQ5JZeuH.js} +1 -1
  268. package/dist/utils/call.d.ts +1 -1
  269. package/dist/utils/call.js +78 -79
  270. package/dist/utils/eventCenter.d.ts +88 -0
  271. package/dist/utils/eventCenter.js +161 -0
  272. package/dist/{utils-DaB7eSu5.js → utils-DuzSgmS6.js} +1 -1
  273. package/package.json +4 -3
  274. package/src/chat/server.ts +0 -1
  275. package/src/components/AudioSetting/AudioMediaControl.vue +1 -3
  276. package/src/components/AudioSetting/AudioSettingTab.vue +1 -2
  277. package/src/components/AudioSetting/MicrophoneSelect.vue +1 -2
  278. package/src/components/AudioSetting/SpeakerSelect.vue +1 -2
  279. package/src/components/AudioSettingPanel/i18n/en-US/index.ts +1 -0
  280. package/src/components/AudioSettingPanel/i18n/zh-CN/index.ts +1 -0
  281. package/src/components/AudioSettingPanel/index.vue +4 -2
  282. package/src/components/BarrageInput/BarrageInputH5.vue +1 -1
  283. package/src/components/BarrageInput/EmojiPicker/EmojiPicker.vue +1 -1
  284. package/src/components/BarrageInput/MessageInputState.ts +160 -0
  285. package/src/components/BarrageInput/TextEditor/TextEditor.vue +1 -1
  286. package/src/components/BarrageInput/type.ts +26 -0
  287. package/src/components/BarrageInput/utils.ts +45 -0
  288. package/src/components/BarrageList/BarrageList.vue +61 -117
  289. package/src/components/BarrageList/BarrageListH5.vue +75 -159
  290. package/src/components/BarrageList/BarrageListState.ts +223 -0
  291. package/src/components/BarrageList/Message/MessageLayout/MessageBubble/MessageBubble.vue +8 -55
  292. package/src/components/BarrageList/Message/MessageLayout/MessageLayout.vue +19 -44
  293. package/src/components/BarrageList/Message/TextMessage/TextMessage.vue +69 -96
  294. package/src/components/BarrageList/Message/TextMessage/emoji.ts +132 -0
  295. package/src/components/CameraButton/index.vue +0 -1
  296. package/src/components/ChatSetting/GroupChatSetting/GroupChatSetting.vue +5 -0
  297. package/src/components/CoGuestPanel/CoGuestPanel.vue +16 -91
  298. package/src/components/CoHostPanel/BattlePanel.vue +1 -4
  299. package/src/components/CoHostPanel/ConfigSettingPanel.vue +2 -8
  300. package/src/components/CoHostPanel/ConnectionPanel.vue +37 -33
  301. package/src/components/CoHostPanel/RecommendHostList.vue +12 -13
  302. package/src/components/CoHostPanel/constants.ts +3 -0
  303. package/src/components/CoHostPanel/i18n/en-US/index.ts +1 -0
  304. package/src/components/CoHostPanel/i18n/zh-CN/index.ts +2 -1
  305. package/src/components/ContactList/ContactInfo/BlacklistInfo/BlacklistInfo.vue +1 -1
  306. package/src/components/ContactList/ContactInfo/ContactInfo.vue +1 -1
  307. package/src/components/ContactList/ContactInfo/FriendApplicationInfo/FriendApplicationInfo.vue +1 -1
  308. package/src/components/ContactList/ContactInfo/FriendInfo/FriendInfo.vue +1 -1
  309. package/src/components/ContactList/ContactInfo/GroupApplicationInfo/GroupApplicationInfo.vue +1 -1
  310. package/src/components/ContactList/ContactInfo/GroupInfo/GroupInfo.vue +1 -1
  311. package/src/components/ContactList/ContactInfo/SearchGroupInfo/SearchGroupInfo.vue +1 -1
  312. package/src/components/ContactList/ContactInfo/SearchUserInfo/SearchUserInfo.vue +1 -1
  313. package/src/components/ContactList/ContactList.vue +1 -1
  314. package/src/components/ContactList/ContactListItem/BlacklistItem/BlacklistItem.vue +1 -1
  315. package/src/components/ContactList/ContactListItem/FriendApplicationItem/FriendApplicationItem.vue +1 -1
  316. package/src/components/ContactList/ContactListItem/FriendItem/FriendItem.vue +1 -1
  317. package/src/components/ContactList/ContactListItem/GroupApplicationItem/GroupApplicationItem.vue +1 -1
  318. package/src/components/ContactList/ContactListItem/GroupItem/GroupItem.vue +1 -1
  319. package/src/components/ContactList/ContactSearch/ContactSearch.vue +1 -1
  320. package/src/components/ConversationList/ConversationActions/ConversationActions.vue +2 -8
  321. package/src/components/ConversationList/ConversationCreate/ConversationCreate.vue +2 -2
  322. package/src/components/ConversationList/ConversationCreate/ConversationCreateButton/ConversationCreateButton.vue +1 -1
  323. package/src/components/ConversationList/ConversationCreate/ConversationCreateGroupDetail/ConversationCreateGroupDetail.vue +1 -1
  324. package/src/components/ConversationList/ConversationCreate/ConversationCreateUserSelectList/ConversationCreateUserSelectList.vue +1 -1
  325. package/src/components/ConversationList/ConversationCreate/ConversationGroupTypeInfo/ConversationGroupTypeInfo.vue +1 -1
  326. package/src/components/ConversationList/ConversationList.vue +2 -2
  327. package/src/components/ConversationList/ConversationListContent/ConversationListContent.vue +1 -1
  328. package/src/components/ConversationList/ConversationListHeader/ConversationListHeader.vue +1 -1
  329. package/src/components/ConversationList/ConversationPlaceHolder/ConversationPlaceHolder.vue +1 -1
  330. package/src/components/ConversationList/ConversationPreview/ConversationPreview.vue +1 -1
  331. package/src/components/ConversationList/ConversationPreview/ConversationPreviewAbstract.vue +1 -1
  332. package/src/components/ConversationList/ConversationPreview/ConversationPreviewTimestamp.vue +4 -4
  333. package/src/components/ConversationList/ConversationPreview/ConversationPreviewTitle.vue +1 -1
  334. package/src/components/ConversationList/ConversationPreview/ConversationPreviewUI.vue +3 -3
  335. package/src/components/ConversationList/ConversationPreview/ConversationPreviewUnread.vue +1 -1
  336. package/src/components/ConversationList/ConversationSearch/ConversationSearch.vue +1 -1
  337. package/src/components/LiveAudienceList/LiveAudienceList.vue +4 -5
  338. package/src/components/LiveAudienceList/LiveAudienceListH5.vue +2 -2
  339. package/src/components/LiveAudienceList/UserActionMenu.vue +7 -48
  340. package/src/components/LiveList/LiveList.vue +5 -5
  341. package/src/components/LiveList/LiveListH5.vue +6 -6
  342. package/src/components/LiveScenePanel/index.vue +3 -2
  343. package/src/components/LiveView/CoreViewDecorate/BattleDecorate.vue +10 -15
  344. package/src/components/LiveView/CoreViewDecorate/BattleUserDecorate.vue +2 -2
  345. package/src/components/LiveView/DefaultStreamViewUI.vue +5 -3
  346. package/src/components/LiveView/PlayerControl/AudioControl.vue +72 -80
  347. package/src/components/LiveView/PlayerControl/MultiResolution.vue +30 -21
  348. package/src/components/LiveView/PlayerControl/PlayerControl.vue +26 -42
  349. package/src/components/LiveView/PlayerControl/PlayerControlState.ts +253 -455
  350. package/src/components/LiveView/PlayerControl/utils/domHelpers.ts +68 -4
  351. package/src/components/LiveView/i18n/en-US/index.ts +2 -2
  352. package/src/components/LiveView/i18n/zh-CN/index.ts +2 -2
  353. package/src/components/LiveView/index.vue +3 -2
  354. package/src/components/MessageInput/AudioCallPicker/AudioCallPicker.vue +8 -6
  355. package/src/components/MessageInput/EmojiPicker/EmojiPicker.vue +7 -3
  356. package/src/components/MessageInput/MessageInput.module.scss +1 -0
  357. package/src/components/MessageInput/MessageInput.vue +3 -1
  358. package/src/components/MessageInput/TextEditor/EditorCore.ts +17 -28
  359. package/src/components/MessageInput/TextEditor/TextEditor.vue +24 -4
  360. package/src/components/MessageInput/TextEditor/extensions/characterCountExtension.ts +159 -0
  361. package/src/components/MessageInput/TextEditor/extensions/imageExtension.ts +79 -0
  362. package/src/components/MessageInput/VideoCallPicker/VideoCallPicker.vue +8 -6
  363. package/src/components/MessageInput/i18n/zh-CN.ts +4 -0
  364. package/src/components/MessageInput/types.d.ts +1 -0
  365. package/src/components/MessageList/Message/AudioMessage/WaveForm.vue +20 -37
  366. package/src/components/MessageList/Message/CustomMessage/CallMessage/CallMessage.vue +5 -3
  367. package/src/components/MessageList/Message/GroupTipMessage/GroupTipMessage.vue +5 -4
  368. package/src/components/MessageList/Message/Message.vue +1 -1
  369. package/src/components/MessageList/Message/MessageLayout/MessageLayout.vue +8 -8
  370. package/src/components/MessageList/Message/VideoMessage/VideoMessage.vue +46 -43
  371. package/src/components/MessageList/Message/VideoMessage/index.ts +1 -1
  372. package/src/components/MessageList/MessageList.vue +2 -0
  373. package/src/components/MessageList/i18n/en-US.ts +66 -0
  374. package/src/components/MessageList/i18n/index.ts +4 -4
  375. package/src/components/MessageList/i18n/zh-CN.ts +66 -0
  376. package/src/components/MicButton/index.vue +3 -3
  377. package/src/components/Search/Search.vue +1 -1
  378. package/src/components/Search/SearchAdvanced/DateRangePicker/DateRangePicker.scss +1 -4
  379. package/src/components/Search/SearchAdvanced/DateRangePicker/DateRangePicker.vue +1 -1
  380. package/src/components/Search/SearchAdvanced/MessageAdvanced/MessageAdvanced.scss +1 -4
  381. package/src/components/Search/SearchAdvanced/MessageAdvanced/MessageAdvanced.vue +1 -1
  382. package/src/components/Search/SearchAdvanced/SearchAdvanced.scss +1 -4
  383. package/src/components/Search/SearchAdvanced/SearchAdvanced.vue +1 -1
  384. package/src/components/Search/SearchAdvanced/SearchTab/SearchTab.scss +1 -4
  385. package/src/components/Search/SearchAdvanced/SearchTab/SearchTab.vue +1 -1
  386. package/src/components/Search/SearchAdvanced/Slider/Slider.scss +1 -4
  387. package/src/components/Search/SearchAdvanced/Slider/Slider.vue +1 -1
  388. package/src/components/Search/SearchAdvanced/UserAdvanced/UserAdvanced.scss +1 -4
  389. package/src/components/Search/SearchAdvanced/UserAdvanced/UserAdvanced.vue +1 -1
  390. package/src/components/Search/SearchBar/SearchBar.scss +3 -6
  391. package/src/components/Search/SearchBar/SearchBar.vue +1 -1
  392. package/src/components/Search/SearchResults/EmptyResult/EmptyResult.vue +1 -1
  393. package/src/components/Search/SearchResults/Loading/Loading.vue +1 -1
  394. package/src/components/Search/SearchResults/SearchResults.vue +1 -1
  395. package/src/components/Search/SearchResults/SearchResultsItem/Conversation/Conversation.vue +1 -1
  396. package/src/components/Search/SearchResults/SearchResultsItem/Group/Group.vue +1 -1
  397. package/src/components/Search/SearchResults/SearchResultsItem/Message/Message.vue +1 -1
  398. package/src/components/Search/SearchResults/SearchResultsItem/SearchResultsItem.vue +1 -1
  399. package/src/components/Search/SearchResults/SearchResultsItem/User/User.vue +1 -1
  400. package/src/components/StreamMixer/LocalMixer/index.vue +6 -8
  401. package/src/components/StreamView/Layout/CustomLayout.vue +2 -2
  402. package/src/components/StreamView/Layout/FloatLayout.vue +88 -83
  403. package/src/components/StreamView/index.vue +28 -14
  404. package/src/components/StreamView/manager/mediaManager.ts +38 -42
  405. package/src/components/UIKitModal/UIKitModal.ts +71 -0
  406. package/src/components/UIKitModal/index.scss +134 -0
  407. package/src/components/UIKitModal/index.ts +1 -0
  408. package/src/components/UIKitModal/index.vue +160 -0
  409. package/src/components/UIKitModal/type.ts +24 -0
  410. package/src/components/UserPicker/UserPicker.vue +1 -1
  411. package/src/components/UserPicker/components/SelectedPanel/SelectedPanel.vue +1 -0
  412. package/src/components/UserPicker/hooks/useSearchFilter.ts +27 -18
  413. package/src/components/UserPicker/i18n/en-US.ts +1 -0
  414. package/src/components/UserPicker/i18n/zh-CN.ts +1 -0
  415. package/src/components/UserPicker/type.ts +1 -1
  416. package/src/components/VideoSetting/CameraSelect.vue +1 -2
  417. package/src/components/VideoSetting/VideoMediaControl.vue +1 -1
  418. package/src/components/VideoSetting/VideoPreview.vue +1 -2
  419. package/src/components/VideoSetting/VideoProfile.vue +1 -1
  420. package/src/components/VideoSetting/VideoSettingTab.vue +9 -5
  421. package/src/components/VideoSettingPanel/CameraSelect.vue +1 -2
  422. package/src/components/VideoSettingPanel/VideoProfile.vue +7 -7
  423. package/src/hooks/useAudioControl.ts +17 -4
  424. package/src/hooks/useRoomEngine.ts +1 -1
  425. package/src/index.ts +3 -0
  426. package/src/report/MetricsKey.ts +16 -0
  427. package/src/report/dataReport.ts +55 -0
  428. package/src/report/index.ts +7 -0
  429. package/src/rtc/index.ts +7 -9
  430. package/src/rtc/server.ts +4 -0
  431. package/src/types/audience.ts +27 -1
  432. package/src/types/battle.ts +87 -4
  433. package/src/types/coGuest.ts +87 -5
  434. package/src/types/device.ts +41 -16
  435. package/src/types/index.ts +2 -2
  436. package/src/types/live.ts +41 -22
  437. package/src/types/seat.ts +28 -4
  438. package/src/utils/call.ts +26 -27
  439. package/src/utils/eventCenter.ts +249 -0
  440. package/dist/DialogPortal-CvJcEAsn.js +0 -417
  441. package/dist/components/BarrageList/Message/FaceMessage/FaceMessage.js +0 -23
  442. package/dist/components/BarrageList/Message/FaceMessage/index.d.ts +0 -3
  443. package/dist/components/BarrageList/Message/FaceMessage/index.js +0 -4
  444. package/dist/components/BarrageList/Message/GroupTipMessage/GroupTipMessage.js +0 -4
  445. package/dist/components/BarrageList/Message/GroupTipMessage/GroupTipMessage.vue.d.ts +0 -16
  446. package/dist/components/BarrageList/Message/GroupTipMessage/index.d.ts +0 -3
  447. package/dist/components/BarrageList/Message/GroupTipMessage/index.js +0 -25
  448. package/dist/components/BarrageList/Message/ImageMessage/ImageMessage.js +0 -71
  449. package/dist/components/BarrageList/Message/ImageMessage/ImageMessage.vue.d.ts +0 -34
  450. package/dist/components/BarrageList/Message/ImageMessage/index.d.ts +0 -3
  451. package/dist/components/BarrageList/Message/ImageMessage/index.js +0 -4
  452. package/dist/components/BarrageList/Message/MergerMessage/MergerMessage.js +0 -9
  453. package/dist/components/BarrageList/Message/MergerMessage/MergerMessage.vue.d.ts +0 -2
  454. package/dist/components/BarrageList/Message/MergerMessage/index.d.ts +0 -3
  455. package/dist/components/BarrageList/Message/MergerMessage/index.js +0 -4
  456. package/dist/components/BarrageList/Message/MessageLayout/MessageMeta/MessageMeta.js +0 -40
  457. package/dist/components/BarrageList/Message/MessageLayout/MessageMeta/MessageMeta.vue.d.ts +0 -54
  458. package/dist/components/BarrageList/Message/MessageLayout/MessageMeta/MessageStatusIcon.js +0 -26
  459. package/dist/components/BarrageList/Message/MessageLayout/MessageMeta/MessageStatusIcon.vue.d.ts +0 -15
  460. package/dist/components/BarrageList/Message/MessageLayout/MessageMeta/index.d.ts +0 -3
  461. package/dist/components/BarrageList/Message/MessageLayout/MessageMeta/index.js +0 -4
  462. package/dist/components/BarrageList/Message/RecalledMessage/RecalledMessage.js +0 -41
  463. package/dist/components/BarrageList/Message/RecalledMessage/RecalledMessage.vue.d.ts +0 -35
  464. package/dist/components/BarrageList/Message/RecalledMessage/index.d.ts +0 -3
  465. package/dist/components/BarrageList/Message/RecalledMessage/index.js +0 -4
  466. package/dist/components/BarrageList/MessageForward/ForwardListItem.js +0 -45
  467. package/dist/components/BarrageList/MessageForward/ForwardListItem.vue.d.ts +0 -17
  468. package/dist/components/BarrageList/MessageForward/MessageForward.js +0 -203
  469. package/dist/components/BarrageList/MessageForward/MessageForward.vue.d.ts +0 -2
  470. package/dist/components/BarrageList/MessageForward/index.d.ts +0 -3
  471. package/dist/components/BarrageList/MessageForward/index.js +0 -4
  472. package/dist/components/StreamView/Layout/MixLayout.js +0 -89
  473. package/dist/components/StreamView/Layout/MixLayout.vue.d.ts +0 -31
  474. package/dist/states/BarrageListState/BarrageListState.d.ts +0 -26
  475. package/dist/states/BarrageListState/BarrageListState.js +0 -122
  476. package/dist/states/BarrageListState/index.d.ts +0 -1
  477. package/dist/states/BarrageListState/index.js +0 -4
  478. package/dist/states/BattleState.js +0 -117
  479. package/dist/states/DeviceState.js +0 -296
  480. package/dist/states/LiveState/index.js +0 -254
  481. package/dist/states/VideoMixerState.js +0 -260
  482. package/src/components/BarrageList/Message/FaceMessage/FaceMessage.vue +0 -43
  483. package/src/components/BarrageList/Message/FaceMessage/index.ts +0 -3
  484. package/src/components/BarrageList/Message/GroupTipMessage/GroupTipMessage.vue +0 -55
  485. package/src/components/BarrageList/Message/GroupTipMessage/index.ts +0 -3
  486. package/src/components/BarrageList/Message/ImageMessage/ImageMessage.vue +0 -181
  487. package/src/components/BarrageList/Message/ImageMessage/index.ts +0 -3
  488. package/src/components/BarrageList/Message/MergerMessage/MergerMessage.vue +0 -6
  489. package/src/components/BarrageList/Message/MergerMessage/index.ts +0 -3
  490. package/src/components/BarrageList/Message/MessageLayout/MessageMeta/MessageMeta.vue +0 -70
  491. package/src/components/BarrageList/Message/MessageLayout/MessageMeta/MessageStatusIcon.vue +0 -40
  492. package/src/components/BarrageList/Message/MessageLayout/MessageMeta/index.ts +0 -3
  493. package/src/components/BarrageList/Message/RecalledMessage/RecalledMessage.vue +0 -82
  494. package/src/components/BarrageList/Message/RecalledMessage/index.ts +0 -3
  495. package/src/components/BarrageList/MessageForward/ForwardListItem.vue +0 -67
  496. package/src/components/BarrageList/MessageForward/MessageForward.vue +0 -388
  497. package/src/components/BarrageList/MessageForward/index.ts +0 -3
  498. package/src/components/StreamView/Layout/MixLayout.vue +0 -144
@@ -1,28 +1,27 @@
1
1
  import type { Ref } from 'vue';
2
2
  import { computed, ref, watch } from 'vue';
3
- import { TRTCCloud, TUIVideoQuality } from '@tencentcloud/tuiroom-engine-js';
3
+ import { TUIVideoQuality } from '@tencentcloud/tuiroom-engine-js';
4
4
  import useRoomEngine from '../../../hooks/useRoomEngine';
5
- import useLiveState from '../../../states/LiveState';
6
5
  import { useLiveSeatState } from '../../../states/LiveSeatState';
7
- // Import utility modules
8
- import {
9
- getDeviceType,
10
- getCurrentOrientation,
6
+ import { useLiveListState } from '../../../states/LiveListState';
7
+ import {
8
+ getDeviceType,
11
9
  shouldRotateToLandscapeForFullscreen,
12
10
  hadLandscapeRotationToUndo,
13
11
  } from './utils/deviceDetection';
14
- import {
15
- FullscreenManager,
16
- FullscreenResult,
12
+ import {
13
+ DOMElementGetter,
14
+ EventListenerManager,
15
+ } from './utils/domHelpers';
16
+ import {
17
+ FullscreenManager,
17
18
  FullscreenMode,
18
19
  OrientationManager,
19
- StyleManager
20
+ StyleManager,
21
+ } from './utils/fullscreenManager';
22
+ import type {
23
+ FullscreenResult
20
24
  } from './utils/fullscreenManager';
21
- import {
22
- DOMElementGetter,
23
- EventListenerManager
24
- } from './utils/domHelpers';
25
- import { LiveStatus } from '../../../types';
26
25
 
27
26
  // Player fill mode enum
28
27
  export enum FillMode {
@@ -48,7 +47,8 @@ export interface PlayerControlState {
48
47
  isLandscapeStyleMode: Ref<boolean>;
49
48
  isPictureInPicture: Ref<boolean>;
50
49
  currentVolume: Ref<number>;
51
-
50
+ isMuted: Ref<boolean>;
51
+
52
52
  // Resolution state properties
53
53
  resolutionList: Ref<Resolution[]>;
54
54
  currentResolution: Ref<Resolution | undefined>;
@@ -67,29 +67,53 @@ export interface PlayerControlState {
67
67
 
68
68
  // Resolution control methods
69
69
  switchResolution: (resolution: Resolution) => Promise<boolean>;
70
- getResolutionList: (roomId: string) => Promise<Resolution[]>;
71
- initializeResolution: (roomId: string, applyResolution?: boolean) => Promise<void>;
72
70
 
73
71
  // Other control methods
74
- setVolume: (volume: number) => Promise<boolean>;
72
+ setVolume: (volume: number) => Promise<boolean>; // Volume range: 0-100
73
+ setMute: (muted: boolean) => Promise<boolean>;
75
74
  changeFillMode: (fillMode: FillMode) => Promise<boolean>;
76
-
77
75
  // Cleanup method
78
76
  cleanup: () => void;
79
77
  }
80
78
 
79
+ // Constants
80
+ const VOLUME_CONSTANTS = {
81
+ // Default volume level when component initializes (100% volume)
82
+ DEFAULT_VOLUME: 100,
83
+ // Minimum allowed volume level (silent)
84
+ MIN_VOLUME: 0,
85
+ // Maximum allowed volume level (full volume)
86
+ MAX_VOLUME: 100,
87
+ // Volume level when muted (silent)
88
+ MUTE_VOLUME: 0,
89
+ };
90
+
91
+ const TIMING_CONSTANTS = {
92
+ // Delay in milliseconds before resuming playback after leaving picture-in-picture
93
+ // Allows browser to handle state transitions naturally
94
+ PIP_RESUME_DELAY: 300,
95
+ };
96
+
97
+ const ARRAY_CONSTANTS = {
98
+ // Index of the first element in an array
99
+ FIRST_INDEX: 0,
100
+ };
101
+
81
102
  // State management
82
103
  const isPlaying = ref(true);
83
104
  const currentFillMode = ref<FillMode>(FillMode.CONTAIN);
84
105
  const isFullscreen = ref(false);
85
106
  const isLandscapeStyleMode = ref(false);
86
107
  const isPictureInPicture = ref(false);
87
- const currentVolume = ref(1.0); // Default volume is 1.0 (100%)
108
+ const currentVolume = ref(VOLUME_CONSTANTS.DEFAULT_VOLUME);
109
+ const isMuted = ref(false); // Mute state - synced across all rooms
110
+
111
+ // Internal storage for volume restoration (not reactive)
112
+ let restoreVolume = VOLUME_CONSTANTS.DEFAULT_VOLUME;
88
113
 
89
114
  // Resolution state management
90
115
  const resolutionList = ref<Resolution[]>([]);
91
116
  const currentResolution = ref<Resolution | undefined>();
92
- const RESOLUTION_INITIALIZED_PREFIX = '[LiveCoreView]ResolutionInitialized';
93
117
 
94
118
  const roomEngine = useRoomEngine();
95
119
 
@@ -98,7 +122,7 @@ const roomEngine = useRoomEngine();
98
122
  */
99
123
  export function usePlayerControlState(): PlayerControlState {
100
124
  // Dependency injection
101
- const { localLiveStatus } = useLiveState();
125
+ const { currentLive } = useLiveListState();
102
126
  const { canvas } = useLiveSeatState();
103
127
 
104
128
  // Event listener management
@@ -108,11 +132,11 @@ export function usePlayerControlState(): PlayerControlState {
108
132
  const orientationListenerId = `player-control-${Date.now()}`;
109
133
 
110
134
  // Computed properties
111
- const isLandscapeStream = computed(() =>
112
- canvas.value ? canvas.value.width > canvas.value.height : false
135
+ const isLandscapeStream = computed(() =>
136
+ canvas.value ? canvas.value.width > canvas.value.height : false,
113
137
  );
114
- const isPortraitStream = computed(() =>
115
- canvas.value ? canvas.value.width < canvas.value.height : false
138
+ const isPortraitStream = computed(() =>
139
+ canvas.value ? canvas.value.width < canvas.value.height : false,
116
140
  );
117
141
 
118
142
  // Device information
@@ -124,7 +148,7 @@ export function usePlayerControlState(): PlayerControlState {
124
148
  const withErrorHandling = async <T>(
125
149
  operation: () => Promise<T>,
126
150
  operationName: string,
127
- fallbackValue: T
151
+ fallbackValue: T,
128
152
  ): Promise<T> => {
129
153
  try {
130
154
  return await operation();
@@ -134,85 +158,29 @@ export function usePlayerControlState(): PlayerControlState {
134
158
  }
135
159
  };
136
160
 
137
- /**
138
- * Video control methods
139
- */
140
-
141
- const syncVolumeState = (): void => {
142
- const video = DOMElementGetter.getVideoElement();
143
- if (video) {
144
- const actualVolume = video.volume;
145
- if (Math.abs(currentVolume.value - actualVolume) > 0.01) { // Use small tolerance for floating point comparison
146
- console.log(`Syncing volume state: ${currentVolume.value} -> ${actualVolume}`);
147
- currentVolume.value = actualVolume;
148
- }
149
- }
150
- };
151
-
152
- const syncPlayingState = (): void => {
153
- const video = DOMElementGetter.getVideoElement();
154
- if (video) {
155
- const actualPlayingState = !video.paused && !video.ended;
156
- if (isPlaying.value !== actualPlayingState) {
157
- console.log(`Syncing playing state: ${isPlaying.value} -> ${actualPlayingState}`);
158
- isPlaying.value = actualPlayingState;
159
- }
160
- }
161
- };
162
-
163
- const resume = async (): Promise<boolean> => {
164
- return withErrorHandling(async () => {
165
- const video = DOMElementGetter.getVideoElement();
166
- if (!video) {
167
- throw new Error('Video element not found');
168
- }
169
- if (DOMElementGetter.hasTcPlayerElement()) {
170
- await video.play();
171
- } else {
172
- const trtcCloudMap = TRTCCloud.subCloudMap;
173
- trtcCloudMap.forEach((trtcCloud: TRTCCloud) => {
174
- const trtc = trtcCloud?._trtc;
175
- trtc?.callExperimentalAPI('resumeRemotePlayer', { userId: '*'})
176
- })
177
- }
178
- isPlaying.value = true;
179
- console.log('Video playback resumed');
180
- return true;
181
- }, 'Resume playback', false);
182
- };
183
-
184
- const pause = async (): Promise<boolean> => {
185
- return withErrorHandling(async () => {
186
- const video = DOMElementGetter.getVideoElement();
187
- if (!video) {
188
- throw new Error('Video element not found');
189
- }
190
- if (DOMElementGetter.hasTcPlayerElement()) {
191
- await video.pause();
192
- } else {
193
- const trtcCloudMap = TRTCCloud.subCloudMap;
194
- trtcCloudMap.forEach((trtcCloud: TRTCCloud) => {
195
- const trtc = trtcCloud?._trtc;
196
- trtc?.callExperimentalAPI('pauseRemotePlayer', { userId: '*'})
197
- })
198
- }
199
- isPlaying.value = false;
200
- console.log('Video playback paused');
201
- return true;
202
- }, 'Pause playback', false);
203
- };
161
+ const resume = async (): Promise<boolean> => withErrorHandling(async () => {
162
+ await roomEngine.instance?.callExperimentalAPI(JSON.stringify({
163
+ api: 'resume',
164
+ params: {},
165
+ }));
166
+ isPlaying.value = true;
167
+ return true;
168
+ }, 'Resume playback', false);
169
+
170
+ const pause = async (): Promise<boolean> => withErrorHandling(async () => {
171
+ await roomEngine.instance?.callExperimentalAPI(JSON.stringify({
172
+ api: 'pause',
173
+ params: {},
174
+ }));
175
+ isPlaying.value = false;
176
+ return true;
177
+ }, 'Pause playback', false);
204
178
 
205
179
  /**
206
180
  * Handle orientation change
207
181
  */
208
182
  const handleOrientationChange = (newOrientation: 'portrait' | 'landscape' | 'unknown'): void => {
209
- // Only handle orientation changes in fullscreen mode
210
- if (!isFullscreen.value) {
211
- return;
212
- }
213
-
214
- // Only handle for landscape streams
215
- if (!isLandscapeStream.value) {
183
+ if (!isFullscreen.value || !isLandscapeStream.value) {
216
184
  return;
217
185
  }
218
186
 
@@ -222,261 +190,186 @@ export function usePlayerControlState(): PlayerControlState {
222
190
  return;
223
191
  }
224
192
 
225
- console.log('Handling orientation change:', {
226
- newOrientation,
227
- deviceType,
228
- isLandscapeStream: isLandscapeStream.value,
229
- isFullscreen: isFullscreen.value
230
- });
231
-
232
- // Smart adjustment of landscape styles
233
193
  StyleManager.smartApplyLandscapeStyles(elements.view, newOrientation);
234
194
  };
235
195
 
236
196
  /**
237
197
  * Fullscreen control methods
238
198
  */
239
- const requestFullscreen = async (): Promise<FullscreenResult> => {
240
- return withErrorHandling(async () => {
241
- const elements = DOMElementGetter.getAllElements();
242
- const validation = DOMElementGetter.validateElements(elements);
243
-
244
- if (!validation.isValid) {
245
- throw new Error(`Missing required DOM elements: ${validation.missingElements.join(', ')}`);
246
- }
199
+ const requestFullscreen = async (): Promise<FullscreenResult> => withErrorHandling(async () => {
200
+ const elements = DOMElementGetter.getAllElements();
201
+ const validation = DOMElementGetter.validateElements(elements);
247
202
 
248
- const currentOrientation = getCurrentOrientation();
249
- const shouldRotateToLandscape = shouldRotateToLandscapeForFullscreen(deviceType, isLandscapeStream.value);
250
-
251
- console.log('Request fullscreen:', {
252
- deviceType,
253
- currentOrientation,
254
- streamType: isLandscapeStream.value ? 'landscape stream' : isPortraitStream.value ? 'portrait stream' : 'unknown',
255
- shouldRotate: shouldRotateToLandscape,
256
- reason: shouldRotateToLandscape ? 'Mobile device in portrait with landscape stream' :
257
- currentOrientation === 'landscape' ? 'Already in landscape orientation' :
258
- !isLandscapeStream.value ? 'Not a landscape stream' :
259
- 'Desktop device or other reason'
260
- });
261
-
262
- const result: FullscreenResult = await FullscreenManager.requestFullscreen(
263
- elements.container!,
264
- elements.view!,
265
- deviceType,
266
- isPortraitStream.value,
267
- shouldRotateToLandscape
268
- );
269
-
270
- if (result.success) {
271
- isFullscreen.value = true;
272
- console.log(`Fullscreen request successful (${result.mode})`);
273
- } else {
274
- console.error('Fullscreen request failed:', result.error);
275
- }
276
- isLandscapeStyleMode.value = result.shouldRotateToLandscape;
277
- return result;
278
- }, 'Request fullscreen', { success: false, mode: FullscreenMode.CSS_SIMULATED, shouldRotateToLandscape: false });
279
- };
203
+ if (!validation.isValid) {
204
+ throw new Error(`Missing required DOM elements: ${validation.missingElements.join(', ')}`);
205
+ }
280
206
 
281
- const exitFullscreen = async (): Promise<FullscreenResult> => {
282
- return withErrorHandling(async () => {
283
- const elements = DOMElementGetter.getAllElements();
284
- if (!elements.view) {
285
- throw new Error('live-core-view element not found');
286
- }
207
+ const shouldRotateToLandscape = shouldRotateToLandscapeForFullscreen(deviceType, isLandscapeStream.value);
287
208
 
288
- const currentOrientation = getCurrentOrientation();
289
- const hadLandscapeRotation = hadLandscapeRotationToUndo(deviceType, isLandscapeStream.value);
290
-
291
- console.log('Exit fullscreen:', {
292
- deviceType,
293
- currentOrientation,
294
- streamType: isLandscapeStream.value ? 'landscape stream' : isPortraitStream.value ? 'portrait stream' : 'unknown',
295
- hadLandscapeRotation,
296
- reason: hadLandscapeRotation ? 'Mobile device with landscape stream in landscape mode' :
297
- currentOrientation === 'portrait' ? 'Already in portrait orientation' :
298
- !isLandscapeStream.value ? 'Not a landscape stream' :
299
- 'Desktop device or other reason'
300
- });
301
-
302
- const result: FullscreenResult = await FullscreenManager.exitFullscreen(
303
- elements.view,
304
- deviceType,
305
- hadLandscapeRotation
306
- );
307
-
308
- // For standard fullscreen, state is updated by event listeners
309
- // For CSS simulated fullscreen, update state directly
310
- if (result.mode === FullscreenMode.CSS_SIMULATED) {
311
- isFullscreen.value = false;
312
- }
209
+ const result: FullscreenResult = await FullscreenManager.requestFullscreen(
210
+ elements.container!,
211
+ elements.view!,
212
+ deviceType,
213
+ isPortraitStream.value,
214
+ shouldRotateToLandscape,
215
+ );
216
+
217
+ if (result.success) {
218
+ isFullscreen.value = true;
219
+ } else {
220
+ console.error('Fullscreen request failed:', result.error);
221
+ }
222
+ isLandscapeStyleMode.value = result.shouldRotateToLandscape;
223
+ return result;
224
+ }, 'Request fullscreen', { success: false, mode: FullscreenMode.CSS_SIMULATED, shouldRotateToLandscape: false });
313
225
 
314
- if (result.success) {
315
- console.log(`Fullscreen exit successful (${result.mode})`);
316
- } else {
317
- console.error('Fullscreen exit failed:', result.error);
318
- }
319
- isLandscapeStyleMode.value = false;
320
- return result;
321
- }, 'Exit fullscreen', { success: false, mode: FullscreenMode.CSS_SIMULATED, shouldRotateToLandscape: false });
322
- };
226
+ const exitFullscreen = async (): Promise<FullscreenResult> => withErrorHandling(async () => {
227
+ const elements = DOMElementGetter.getAllElements();
228
+ if (!elements.view) {
229
+ throw new Error('live-core-view element not found');
230
+ }
231
+
232
+ const hadLandscapeRotation = hadLandscapeRotationToUndo(deviceType, isLandscapeStream.value);
233
+
234
+ const result: FullscreenResult = await FullscreenManager.exitFullscreen(
235
+ elements.view,
236
+ deviceType,
237
+ hadLandscapeRotation,
238
+ );
239
+
240
+ if (result.mode === FullscreenMode.CSS_SIMULATED) {
241
+ isFullscreen.value = false;
242
+ }
243
+
244
+ if (!result.success) {
245
+ console.error('Fullscreen exit failed:', result.error);
246
+ }
247
+ isLandscapeStyleMode.value = false;
248
+ return result;
249
+ }, 'Exit fullscreen', { success: false, mode: FullscreenMode.CSS_SIMULATED, shouldRotateToLandscape: false });
323
250
 
324
251
  /**
325
252
  * Picture-in-picture control methods
326
253
  */
327
- const requestPictureInPicture = async (): Promise<boolean> => {
328
- return withErrorHandling(async () => {
329
- const video = DOMElementGetter.getVideoElement();
330
- if (!video) {
331
- throw new Error('Video element not found');
332
- }
254
+ const requestPictureInPicture = async (): Promise<boolean> => withErrorHandling(async () => {
255
+ const video = DOMElementGetter.getVideoElement();
256
+ if (!video) {
257
+ throw new Error('Video element not found');
258
+ }
333
259
 
334
- if (!video.requestPictureInPicture) {
335
- throw new Error('Picture-in-picture not supported in current environment');
336
- }
260
+ if (!video.requestPictureInPicture) {
261
+ throw new Error('Picture-in-picture not supported in current environment');
262
+ }
337
263
 
338
- // Ensure event listeners are set
339
- setupVideoEventListeners();
340
- await video.requestPictureInPicture();
341
-
342
- console.log('Picture-in-picture request successful');
343
- return true;
344
- }, 'Request picture-in-picture', false);
345
- };
264
+ setupVideoEventListeners();
265
+ await video.requestPictureInPicture();
266
+ return true;
267
+ }, 'Request picture-in-picture', false);
346
268
 
347
- const exitPictureInPicture = async (): Promise<boolean> => {
348
- return withErrorHandling(async () => {
349
- if (!document.exitPictureInPicture) {
350
- throw new Error('Exit picture-in-picture not supported in current environment');
351
- }
269
+ const exitPictureInPicture = async (): Promise<boolean> => withErrorHandling(async () => {
270
+ if (!document.exitPictureInPicture) {
271
+ throw new Error('Exit picture-in-picture not supported in current environment');
272
+ }
352
273
 
353
- await document.exitPictureInPicture();
354
- console.log('Picture-in-picture exit successful');
355
- return true;
356
- }, 'Exit picture-in-picture', false);
357
- };
274
+ await document.exitPictureInPicture();
275
+ return true;
276
+ }, 'Exit picture-in-picture', false);
358
277
 
359
278
  /**
360
279
  * Resolution control methods
361
280
  */
362
- const switchResolution = async (resolution: Resolution): Promise<boolean> => {
363
- return withErrorHandling(async () => {
364
- if (!roomEngine.instance) {
365
- throw new Error('Room engine instance not available');
366
- }
367
- await roomEngine.instance.callExperimentalAPI(
368
- JSON.stringify({
369
- api: 'switchPlaybackQuality',
370
- params: {
371
- quality: resolution,
372
- autoSwitch: false,
373
- },
374
- }),
375
- );
376
- if (!isPlaying.value) {
377
- isPlaying.value = true;
378
- }
379
- currentResolution.value = resolution;
380
- console.log(`Resolution switched to: ${resolution}`);
381
- return true;
382
- }, 'Switch resolution', false);
383
- };
281
+ const switchResolution = async (resolution: Resolution): Promise<boolean> => withErrorHandling(async () => {
282
+ if (!roomEngine.instance) {
283
+ throw new Error('Room engine instance not available');
284
+ }
285
+ console.debug('Switching to resolution:', resolution);
286
+ await roomEngine.instance.callExperimentalAPI(
287
+ JSON.stringify({
288
+ api: 'switchPlaybackQuality',
289
+ params: {
290
+ quality: resolution,
291
+ autoSwitch: false,
292
+ },
293
+ }),
294
+ );
295
+ if (!isPlaying.value) {
296
+ isPlaying.value = true;
297
+ }
298
+ currentResolution.value = resolution;
299
+ return true;
300
+ }, 'Switch resolution', false);
384
301
 
385
- const getResolutionList = async (roomId: string): Promise<Resolution[]> => {
386
- return withErrorHandling(async () => {
387
- if (!roomEngine.instance) {
388
- throw new Error('Room engine instance not available');
389
- }
390
-
391
- const resolutions = await roomEngine.instance.callExperimentalAPI(
392
- JSON.stringify({
393
- api: 'queryPlaybackQualityList',
394
- params: {
395
- roomId: roomId,
396
- },
397
- }),
398
- );
399
-
400
- console.log(`Retrieved resolution list for room ${roomId}:`, resolutions);
401
- return (resolutions || []) as Resolution[];
402
- }, 'Get resolution list', []);
403
- };
302
+ const getResolutionList = async (roomId: string): Promise<Resolution[]> => withErrorHandling(async () => {
303
+ if (!roomEngine.instance) {
304
+ throw new Error('Room engine instance not available');
305
+ }
404
306
 
307
+ const resolutions = await roomEngine.instance.callExperimentalAPI(
308
+ JSON.stringify({
309
+ api: 'queryPlaybackQualityList',
310
+ params: {
311
+ roomId,
312
+ },
313
+ }),
314
+ );
405
315
 
406
- const initializeResolution = async (roomId: string, applyResolution: boolean = true): Promise<void> => {
316
+ return (resolutions || []) as Resolution[];
317
+ }, 'Get resolution list', []);
318
+
319
+ const initializeResolution = async (roomId: string, applyResolution = true): Promise<void> => {
407
320
  try {
408
- // Check if resolution has been initialized for this room
409
- const initializedKey = `${RESOLUTION_INITIALIZED_PREFIX}_${roomId}`;
410
- const hasInitialized = localStorage.getItem(initializedKey) === 'true';
411
-
412
- // Get available resolutionList
413
321
  const availableResolutions = await getResolutionList(roomId);
414
322
  resolutionList.value = availableResolutions;
415
-
416
- if (availableResolutions.length === 0) {
417
- console.warn('No resolutions available for room:', roomId);
323
+
324
+ if (availableResolutions.length === ARRAY_CONSTANTS.FIRST_INDEX) {
325
+ console.warn('[Resolution] No resolutions available for room:', roomId);
326
+ currentResolution.value = undefined;
418
327
  return;
419
328
  }
420
-
421
- // Always set current resolution if it's not set or if it's not in the available list
422
- if (!currentResolution.value || !availableResolutions.includes(currentResolution.value)) {
423
- currentResolution.value = availableResolutions[0];
424
- }
425
-
426
- // Only apply resolution if it hasn't been initialized for this room or explicitly requested
427
- const shouldApplyResolution = applyResolution && !hasInitialized && currentResolution.value !== undefined;
428
- if (shouldApplyResolution) {
429
- await switchResolution(currentResolution.value!);
430
- // Mark as initialized for this room
431
- localStorage.setItem(initializedKey, 'true');
329
+
330
+ // Always set to the first available resolution when entering a room
331
+ const targetResolution = availableResolutions[ARRAY_CONSTANTS.FIRST_INDEX];
332
+ currentResolution.value = targetResolution;
333
+ if (applyResolution) {
334
+ await switchResolution(targetResolution);
432
335
  }
433
-
434
- console.log(`Resolution initialized for room ${roomId}:`, {
435
- availableResolutions: availableResolutions,
436
- currentResolution: currentResolution.value,
437
- applied: shouldApplyResolution,
438
- hasInitialized,
439
- });
440
336
  } catch (error) {
441
- console.error('Failed to initialize resolution:', error);
337
+ console.error('[Resolution] Failed to initialize resolution:', error);
442
338
  }
443
339
  };
444
340
 
445
341
  /**
446
342
  * Other control methods
447
343
  */
448
- const setVolume = async (volume: number): Promise<boolean> => {
449
- return withErrorHandling(async () => {
450
- if (volume < 0 || volume > 1) {
451
- throw new Error('Volume value must be between 0-1');
452
- }
453
- const trtcCloudMap = TRTCCloud.subCloudMap;
454
- if(volume === 0) {
455
- trtcCloudMap.forEach((trtcCloud: TRTCCloud) => {
456
- const trtc = trtcCloud?._trtc;
457
- trtc?.muteRemoteAudio('*', true)
458
- })
459
- } else {
460
- trtcCloudMap.forEach((trtcCloud: TRTCCloud) => {
461
- const trtc = trtcCloud?._trtc;
462
- trtc?.muteRemoteAudio('*', false)
463
- })
464
- }
465
- roomEngine.instance?.setAudioPlayoutVolume({ volume: volume * 100 });
466
- currentVolume.value = volume;
467
- console.log(`Video volume set to: ${volume}`);
468
- return true;
469
- }, 'Set volume', false);
470
- };
344
+ const setVolume = async (volume: number): Promise<boolean> => withErrorHandling(async () => {
345
+ if (volume < VOLUME_CONSTANTS.MIN_VOLUME || volume > VOLUME_CONSTANTS.MAX_VOLUME) {
346
+ throw new Error(`Volume value must be between ${VOLUME_CONSTANTS.MIN_VOLUME}-${VOLUME_CONSTANTS.MAX_VOLUME}`);
347
+ }
348
+ await roomEngine.instance?.setAudioPlayoutVolume({ volume });
349
+ currentVolume.value = volume;
350
+ restoreVolume = volume;
351
+ isMuted.value = volume == VOLUME_CONSTANTS.MUTE_VOLUME;
352
+ return true;
353
+ }, 'Set volume', false);
354
+
355
+ const setMute = async (muted: boolean): Promise<boolean> => withErrorHandling(async () => {
356
+ let volume;
357
+ if (muted) {
358
+ restoreVolume = currentVolume.value;
359
+ volume = VOLUME_CONSTANTS.MUTE_VOLUME;
360
+ } else {
361
+ volume = restoreVolume || VOLUME_CONSTANTS.DEFAULT_VOLUME;
362
+ }
363
+ await roomEngine.instance?.setAudioPlayoutVolume({ volume });
364
+ currentVolume.value = volume;
365
+ isMuted.value = muted;
366
+ return true;
367
+ }, 'Set mute', false);
471
368
 
472
- const changeFillMode = async (fillMode: FillMode): Promise<boolean> => {
473
- return withErrorHandling(async () => {
474
- currentFillMode.value = fillMode;
475
- console.log(`Fill mode changed to: ${fillMode}`);
476
- // TODO: Implement actual fill mode logic
477
- return true;
478
- }, 'Change fill mode', false);
479
- };
369
+ const changeFillMode = async (fillMode: FillMode): Promise<boolean> => withErrorHandling(async () => {
370
+ currentFillMode.value = fillMode;
371
+ return true;
372
+ }, 'Change fill mode', false);
480
373
 
481
374
  /**
482
375
  * Handle style cleanup when exiting fullscreen
@@ -485,55 +378,35 @@ export function usePlayerControlState(): PlayerControlState {
485
378
  try {
486
379
  const elements = DOMElementGetter.getAllElements();
487
380
  if (!elements.view) {
488
- console.warn('live-core-view element not found for fullscreen exit cleanup');
381
+ console.warn('View element not found for fullscreen exit cleanup');
489
382
  return;
490
383
  }
491
384
 
492
- console.log('Executing fullscreen exit style cleanup:', {
493
- deviceType,
494
- hasLandscapeStream: isLandscapeStream.value,
495
- currentOrientation: getCurrentOrientation()
496
- });
497
-
498
- // Remove all fullscreen related styles
499
385
  StyleManager.removeFullscreenStyles(elements.view);
500
386
  StyleManager.removeLandscapeStyles(elements.view);
501
387
 
502
- // If mobile device, try to unlock screen orientation
503
388
  if (deviceType !== 'desktop') {
504
- OrientationManager.unlockOrientation().catch(error => {
505
- console.warn('Failed to unlock orientation during cleanup:', error);
389
+ OrientationManager.unlockOrientation().catch(() => {
390
+ // Ignore orientation unlock errors in non-desktop environments
506
391
  });
507
392
  }
508
-
509
393
  isLandscapeStyleMode.value = false;
510
- console.log('Fullscreen exit style cleanup completed');
511
394
  } catch (error) {
512
- console.error('Fullscreen exit style cleanup failed:', error);
395
+ console.error('Fullscreen exit cleanup failed:', error);
513
396
  }
514
397
  };
515
398
 
516
399
  /**
517
- * Event listener setup
400
+ * Event listener setup for fullscreen state changes
401
+ * Handles fullscreen API events across different browsers and visibility changes
518
402
  */
519
403
  const setupFullscreenEventListeners = (): void => {
520
404
  const handleFullscreenChange = () => {
521
405
  const isCurrentlyFullscreen = !!document.fullscreenElement;
522
406
  const wasFullscreen = isFullscreen.value;
523
-
524
- console.log('Fullscreen state change:', {
525
- fullscreenElement: document.fullscreenElement,
526
- isCurrentlyFullscreen,
527
- previousValue: wasFullscreen,
528
- deviceType,
529
- changeType: isCurrentlyFullscreen ? 'entered' : 'exited'
530
- });
531
-
532
- // Update state
407
+
533
408
  isFullscreen.value = isCurrentlyFullscreen;
534
- // If exiting fullscreen, need to cleanup styles
535
409
  if (wasFullscreen && !isCurrentlyFullscreen) {
536
- console.log('Detected passive fullscreen exit, executing style cleanup');
537
410
  handleFullscreenExit();
538
411
  }
539
412
  };
@@ -544,162 +417,90 @@ export function usePlayerControlState(): PlayerControlState {
544
417
  eventManager.addListener('mozfullscreenchange', document, 'mozfullscreenchange', handleFullscreenChange);
545
418
  eventManager.addListener('MSFullscreenChange', document, 'MSFullscreenChange', handleFullscreenChange);
546
419
 
547
- // Add additional detection mechanisms for non-standard fullscreen exits (like Android back button)
548
420
  const handleVisibilityChange = () => {
549
- // When page visibility changes, check if fullscreen state is consistent
550
421
  if (document.visibilityState === 'visible' && isFullscreen.value) {
551
422
  const actuallyFullscreen = !!document.fullscreenElement;
552
423
  if (!actuallyFullscreen) {
553
- console.log('Detected fullscreen state inconsistency via visibilitychange, executing cleanup');
554
424
  isFullscreen.value = false;
555
425
  handleFullscreenExit();
556
426
  }
557
427
  }
558
428
  };
559
429
 
560
- // Listen to page visibility changes (Android back button scenarios)
561
430
  eventManager.addListener('visibilitychange', document, 'visibilitychange', handleVisibilityChange);
562
431
  };
563
432
 
564
433
  const setupVideoEventListeners = (): void => {
565
434
  const video = DOMElementGetter.getVideoElement();
566
- if (!video) return;
435
+ if (!video) {
436
+ console.warn('Video element not found for setting up event listeners');
437
+ return;
438
+ }
567
439
 
568
440
  const handleEnterPictureInPicture = () => {
569
- console.log('Entered picture-in-picture mode');
570
441
  isPictureInPicture.value = true;
571
442
  };
572
443
 
573
444
  const handleLeavePictureInPicture = () => {
574
- console.log('Left picture-in-picture mode');
575
445
  isPictureInPicture.value = false;
576
- setTimeout(resume, 300);
577
- };
578
-
579
- // Video playback state change handlers
580
- const handlePlay = () => {
581
- console.log('Video play event detected');
582
- isPlaying.value = true;
583
- };
584
-
585
- const handlePause = () => {
586
- console.log('Video pause event detected');
587
- isPlaying.value = false;
588
- };
589
-
590
- const handleEnded = () => {
591
- console.log('Video ended event detected');
592
- isPlaying.value = false;
593
- };
594
-
595
- const handleLoadStart = () => {
596
- console.log('Video load start event detected');
597
- // Sync initial state when video loads
598
- isPlaying.value = !video.paused;
446
+ setTimeout(resume, TIMING_CONSTANTS.PIP_RESUME_DELAY);
599
447
  };
600
448
 
601
- const handleCanPlay = () => {
602
- console.log('Video can play event detected');
603
- // Sync state when video becomes playable
604
- isPlaying.value = !video.paused;
605
- };
606
-
607
- const handleSeeking = () => {
608
- console.log('Video seeking event detected');
609
- // Sync state during seeking
610
- syncPlayingState();
611
- };
612
-
613
- const handleSeeked = () => {
614
- console.log('Video seeked event detected');
615
- // Sync state after seeking
616
- syncPlayingState();
617
- };
618
-
619
- const handleTimeUpdate = () => {
620
- // Only sync occasionally during time updates to avoid too many calls
621
- if (Math.random() < 0.1) { // 10% chance per timeupdate event
622
- syncPlayingState();
623
- }
624
- };
625
-
626
- const handleVolumeChange = () => {
627
- console.log('Video volume change event detected');
628
- // Sync state when volume changes (might indicate user interaction)
629
- syncPlayingState();
630
- syncVolumeState();
631
- };
632
-
633
- // Add picture-in-picture event listeners
634
449
  eventManager.addListener('enterpictureinpicture', video, 'enterpictureinpicture', handleEnterPictureInPicture);
635
450
  eventManager.addListener('leavepictureinpicture', video, 'leavepictureinpicture', handleLeavePictureInPicture);
636
-
637
- // Add video playback state event listeners
638
- eventManager.addListener('play', video, 'play', handlePlay);
639
- eventManager.addListener('pause', video, 'pause', handlePause);
640
- eventManager.addListener('ended', video, 'ended', handleEnded);
641
- eventManager.addListener('loadstart', video, 'loadstart', handleLoadStart);
642
- eventManager.addListener('canplay', video, 'canplay', handleCanPlay);
643
-
644
- // Add additional state sync events
645
- eventManager.addListener('seeking', video, 'seeking', handleSeeking);
646
- eventManager.addListener('seeked', video, 'seeked', handleSeeked);
647
- eventManager.addListener('timeupdate', video, 'timeupdate', handleTimeUpdate);
648
- eventManager.addListener('volumechange', video, 'volumechange', handleVolumeChange);
649
-
650
451
  };
651
452
 
652
453
  /**
653
454
  * Cleanup method
654
455
  */
655
456
  const cleanup = (): void => {
656
- console.log('Cleaning up player control state...');
657
-
658
- // Remove orientation listener
659
457
  OrientationManager.removeOrientationListener(orientationListenerId);
660
-
661
- // Remove all event listeners
662
458
  eventManager.removeAllListeners();
663
- console.log(`Cleaned up ${eventManager.getListenerCount()} event listeners`);
664
459
  };
665
460
 
666
- // Initialize
667
461
  setupFullscreenEventListeners();
668
462
  setupVideoEventListeners();
669
-
670
- // Setup orientation listener for dynamic style adjustment
671
463
  OrientationManager.addOrientationListener(orientationListenerId, handleOrientationChange);
672
-
673
- // Initial state sync
674
- syncPlayingState();
675
- syncVolumeState();
676
-
677
- watch(localLiveStatus, (newStatus) => {
678
- if(newStatus === LiveStatus.Ended) {
679
- exitFullscreen();
680
- exitPictureInPicture();
681
- isPlaying.value = true;
682
- isFullscreen.value = false;
683
- isPictureInPicture.value = false;
684
- currentVolume.value = 1.0;
685
- }
686
- })
464
+
465
+ watch(
466
+ () => currentLive.value?.liveId,
467
+ async (newLiveId) => {
468
+ if (newLiveId) {
469
+ isPlaying.value = true;
470
+ isPictureInPicture.value = false;
471
+ isFullscreen.value = false;
472
+ resolutionList.value = [];
473
+ currentResolution.value = undefined;
474
+ // When pulling a TRTC stream, this interface has a cache, but when using TCPlayer, there is no cache
475
+ await setVolume(currentVolume.value);
476
+ await initializeResolution(newLiveId, false);
477
+
478
+ // Print player control state after entering room
479
+ console.log('[PlayerControl] State after entering room:', JSON.stringify({
480
+ isPlaying: isPlaying.value,
481
+ currentFillMode: currentFillMode.value,
482
+ isFullscreen: isFullscreen.value,
483
+ isLandscapeStyleMode: isLandscapeStyleMode.value,
484
+ isPictureInPicture: isPictureInPicture.value,
485
+ currentVolume: currentVolume.value,
486
+ resolutionList: resolutionList.value,
487
+ currentResolution: currentResolution.value,
488
+ }));
489
+ }
490
+ },
491
+ );
687
492
 
688
493
  // Return interface implementation
689
494
  return {
690
- // State
691
495
  isPlaying,
692
496
  currentFillMode,
693
497
  isFullscreen,
694
498
  isLandscapeStyleMode,
695
499
  isPictureInPicture,
696
500
  currentVolume,
697
-
698
- // Resolution state
501
+ isMuted,
699
502
  resolutionList,
700
503
  currentResolution,
701
-
702
- // Methods
703
504
  resume,
704
505
  pause,
705
506
  requestFullscreen,
@@ -707,12 +508,9 @@ export function usePlayerControlState(): PlayerControlState {
707
508
  requestPictureInPicture,
708
509
  exitPictureInPicture,
709
510
  switchResolution,
710
- getResolutionList,
711
- initializeResolution,
712
511
  setVolume,
512
+ setMute,
713
513
  changeFillMode,
714
-
715
- // Cleanup
716
514
  cleanup,
717
515
  };
718
516
  }