@zhangxuejing123./sip-phone-sdk 0.0.0

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 (49) hide show
  1. package/README.md +24 -0
  2. package/babel.config.js +5 -0
  3. package/dist/demo.html +21 -0
  4. package/dist/media/outgoing-call2.b8558579.mp3 +0 -0
  5. package/dist/sip-phone-sdk.common.js +42439 -0
  6. package/dist/sip-phone-sdk.css +5 -0
  7. package/dist/sip-phone-sdk.umd.js +42449 -0
  8. package/dist/sip-phone-sdk.umd.min.js +14 -0
  9. package/jsconfig.json +19 -0
  10. package/package-lock.json +15671 -0
  11. package/package.json +99 -0
  12. package/public/SIP_MIX_WEB.js +50 -0
  13. package/public/en.js +24 -0
  14. package/public/favicon.ico +0 -0
  15. package/public/index.html +32 -0
  16. package/public/index.test.html +31 -0
  17. package/public/zh.js +24 -0
  18. package/src/.DS_Store +0 -0
  19. package/src/App.vue +136 -0
  20. package/src/assets/.DS_Store +0 -0
  21. package/src/assets/adudio-open.png +0 -0
  22. package/src/assets/audio-close.png +0 -0
  23. package/src/assets/call-down.png +0 -0
  24. package/src/assets/camera-close.png +0 -0
  25. package/src/assets/camera-open.png +0 -0
  26. package/src/assets/icon_Recording_Fill_Red_Active.svg +15 -0
  27. package/src/assets/icon_Recording_Fill_Red_Inactive.svg +15 -0
  28. package/src/assets/img_Avatar_User.png +0 -0
  29. package/src/assets/normal-logo.png +0 -0
  30. package/src/assets/outgoing-call2.mp3 +0 -0
  31. package/src/components/DialPanelMini.vue +179 -0
  32. package/src/components/MobilePhone copy 2.vue +1173 -0
  33. package/src/components/MobilePhone copy.vue +1046 -0
  34. package/src/components/MobilePhone.vue +1157 -0
  35. package/src/components/index.js +36 -0
  36. package/src/components/vuetify.css +29663 -0
  37. package/src/index.js +100 -0
  38. package/src/lang/en.js +24 -0
  39. package/src/lang/zh.js +24 -0
  40. package/src/libs/SIP_MIX_WEB.js +50 -0
  41. package/src/libs/en.js +24 -0
  42. package/src/libs/tool.js +312 -0
  43. package/src/libs/zh.js +24 -0
  44. package/src/main.js +24 -0
  45. package/src/plugins/vuetify.js +11 -0
  46. package/src/utils/rem.js +22 -0
  47. package/vue.config copy 2.js +39 -0
  48. package/vue.config copy.js +11 -0
  49. package/vue.config.js +39 -0
package/src/index.js ADDED
@@ -0,0 +1,100 @@
1
+ import Vue from 'vue'
2
+ import VueI18n from 'vue-i18n'
3
+ import Vuetify from 'vuetify'
4
+ import 'vuetify/dist/vuetify.min.css'
5
+ import '@mdi/font/css/materialdesignicons.min.css'
6
+
7
+ // 导入组件
8
+ import MobilePhone from './components/MobilePhone.vue'
9
+ import DialPanelMini from './components/DialPanelMini.vue' // 确保导入所有组件
10
+ // 导入其他组件...
11
+
12
+ // 导入语言包
13
+ let zh, en;
14
+
15
+ try {
16
+ zh = require('@/libs/zh.js').default;
17
+ en = require('@/libs/en.js').default;
18
+ } catch (error) {
19
+ console.warn('Language files not found, using empty translations');
20
+ zh = {};
21
+ en = {};
22
+ }
23
+
24
+ // 动态加载 Vuetify
25
+ let vuetifyInstance
26
+ if (typeof window !== 'undefined' && window.Vuetify) {
27
+ vuetifyInstance = window.Vuetify
28
+ } else {
29
+ Vue.use(Vuetify)
30
+ vuetifyInstance = new Vuetify({
31
+ icons: {
32
+ iconfont: 'mdi',
33
+ },
34
+ theme: {
35
+ dark: false,
36
+ },
37
+ })
38
+ }
39
+
40
+ // 配置 i18n
41
+ const i18n = new VueI18n({
42
+ locale: 'zh-CN',
43
+ fallbackLocale: 'en-US',
44
+ messages: { 'zh-CN': zh, 'en-US': en },
45
+ silentTranslationWarn: true
46
+ })
47
+
48
+ const components = {
49
+ 'sip-phone': MobilePhone,
50
+ 'dial-panel-mini': DialPanelMini
51
+ // 注册其他组件...
52
+ }
53
+
54
+ const install = (Vue) => {
55
+ // 使用 Vuetify
56
+ if (!Vue.prototype.$vuetify) {
57
+ Vue.use(Vuetify)
58
+ Vue.prototype.$vuetify = vuetifyInstance
59
+ }
60
+
61
+ // 使用 VueI18n
62
+ if (!Vue.prototype.$i18n) {
63
+ Vue.use(VueI18n)
64
+ Vue.prototype.$i18n = i18n
65
+ }
66
+
67
+ // 注册组件
68
+ Object.keys(components).forEach(key => {
69
+ Vue.component(key, components[key])
70
+ })
71
+
72
+ // 添加实例方法
73
+ Vue.prototype.$sipPhone = {
74
+ version: '1.0.0',
75
+ init(config = {}) {
76
+ // 初始化配置
77
+ if (config.locale) {
78
+ i18n.locale = config.locale
79
+ }
80
+ // 其他初始化逻辑...
81
+ },
82
+ // 添加其他方法...
83
+ }
84
+ }
85
+
86
+ // 自动安装
87
+ if (typeof window !== 'undefined' && window.Vue) {
88
+ window.Vue.use({ install })
89
+ }
90
+
91
+ export default {
92
+ install,
93
+ // 单独导出组件,支持按需加载
94
+ MobilePhone,
95
+ DialPanelMini,
96
+ // 导出其他组件...
97
+ }
98
+
99
+ // 导出命名空间
100
+ // export * from './components'
package/src/lang/en.js ADDED
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Created by Wade (weida1985@163.com) on 2023/8/1.
3
+ */
4
+ const en={
5
+ serverConnecting: 'Server connecting',
6
+ serverConnected: 'Server connected',
7
+ connectionClosed: 'Connection closed',
8
+ clickButtonToMakeCall: 'Click button to make call',
9
+ gotCameraStreamFailed: 'Got camera stream failed',
10
+ calling: 'Calling',
11
+ pleaseBePatient: 'Please be patient',
12
+ cameraOrMicUnsupported: 'Camera or mic unsupported',
13
+ WebRTCUnsupported: 'WebRTC unsupported',
14
+ connectionFailedPleaseCheckYourNetwork: 'Connection failed. Please check your network',
15
+ registered: 'Registered',
16
+ unregistered: 'Unregistered',
17
+ registerFailed: 'Register failed',
18
+ cancelled: 'Cancelled',
19
+ hangedUp: 'hangedUp',
20
+ remoteRinging: 'Remote ringing',
21
+ remoteAccept: 'Remote accept'
22
+ }
23
+
24
+ export default en
package/src/lang/zh.js ADDED
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Created by Wade (weida1985@163.com) on 2023/8/1.
3
+ */
4
+ const zh={
5
+ serverConnecting: '服务器连接中',
6
+ serverConnected: '服务器已连接',
7
+ connectionClosed: '连接已断开',
8
+ clickButtonToMakeCall: '点击拨号开始呼叫',
9
+ gotCameraStreamFailed: '获取摄像头视频流失败',
10
+ calling: '呼叫中',
11
+ // pleaseBePatient: '请耐心等待',
12
+ pleaseBePatient: '正在邀请对方加入视频通话...',
13
+ cameraOrMicUnsupported: '不支持开启摄像头或Mic接口',
14
+ WebRTCUnsupported: '不支持WebRTC',
15
+ connectionFailedPleaseCheckYourNetwork: '服务器连接失败,请检查网络。',
16
+ registered: '已注册',
17
+ unregistered: '已注销',
18
+ registerFailed: '注册失败',
19
+ cancelled: '已取消',
20
+ hangedUp: '已挂机',
21
+ remoteRinging: '对端开始振铃',
22
+ remoteAccept: '已接通'
23
+ }
24
+ export default zh