@dolphinweex/weex-harmony 0.1.104 → 0.1.106

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dolphinweex/weex-harmony",
3
- "version": "0.1.104",
3
+ "version": "0.1.106",
4
4
  "description": "weex harmony adapter",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -113,7 +113,7 @@ export default {
113
113
  captureImage(params,callback) {
114
114
  delete params.refId
115
115
  weexModule.callNative(
116
- 'ipcLinkApi',
116
+ 'iotLinkApi',
117
117
  {
118
118
  method: 'captureImage',
119
119
  name: this.embedId,
@@ -124,7 +124,7 @@ export default {
124
124
  },
125
125
  switchVideoQuality(params,callback) {
126
126
  weexModule.callNative(
127
- 'ipcLinkApi',
127
+ 'iotLinkApi',
128
128
  {
129
129
  method: 'switchVideoQuality',
130
130
  name: this.embedId,
@@ -135,7 +135,7 @@ export default {
135
135
  },
136
136
  getVideoNetworkSpeed(params,callback) {
137
137
  weexModule.callNative(
138
- 'ipcLinkApi',
138
+ 'iotLinkApi',
139
139
  {
140
140
  method: 'getVideoNetworkSpeed',
141
141
  name: this.embedId,
@@ -146,7 +146,7 @@ export default {
146
146
  },
147
147
  startRecord(params,callback) {
148
148
  weexModule.callNative(
149
- 'ipcLinkApi',
149
+ 'iotLinkApi',
150
150
  {
151
151
  method: 'startRecord',
152
152
  name: this.embedId,
@@ -157,7 +157,7 @@ export default {
157
157
  },
158
158
  stopRecord(params,callback) {
159
159
  weexModule.callNative(
160
- 'ipcLinkApi',
160
+ 'iotLinkApi',
161
161
  {
162
162
  method: 'stopRecord',
163
163
  name: this.embedId,
@@ -168,7 +168,7 @@ export default {
168
168
  },
169
169
  changeAudioStatus(params,callback){
170
170
  weexModule.callNative(
171
- 'ipcLinkApi',
171
+ 'iotLinkApi',
172
172
  {
173
173
  method: 'changeAudioStatus',
174
174
  name: this.embedId,
@@ -127,6 +127,10 @@ export default {
127
127
  type: String,
128
128
  default: '',
129
129
  },
130
+ controls: {
131
+ type: String,
132
+ default: true,
133
+ },
130
134
  isShowTopRightViewOnPortrait: {
131
135
  type: Boolean,
132
136
  default: false,
@@ -138,6 +142,7 @@ export default {
138
142
  ...this.hosUniqueProps, // 鸿蒙原生组件独有属性
139
143
  width: this.width,
140
144
  height: this.height,
145
+ controls: this.controls,
141
146
  onFullscreenChange: this.onFullscreenChange,
142
147
  // 视频播放器相关属性
143
148
  config: this.config,
@@ -170,6 +175,7 @@ export default {
170
175
  onStartDownload: this.onStartDownload,
171
176
  onPreviewImageClick: this.onPreviewImageClick,
172
177
  onCaptureCompletion: this.onCaptureCompletion,
178
+ onPlayerClick: this.onPlayerClick
173
179
  };
174
180
  },
175
181
  },
@@ -186,6 +192,34 @@ export default {
186
192
  });
187
193
  },
188
194
  methods: {
195
+ setSpeed(params){
196
+ // {"speed": 1}
197
+ console.log('cdj---setSpeed',JSON.stringify(params))
198
+ delete params.refId
199
+ weexModule.callNative(
200
+ 'ijkLinkApi',
201
+ {
202
+ method: 'setSpeed',
203
+ name: this.embedId,
204
+ params
205
+ },
206
+ callback
207
+ );
208
+ },
209
+ //{"progress": 221}
210
+ seek(params){
211
+ console.log('cdj---setSpseekeed',JSON.stringify(params))
212
+ delete params.refId
213
+ weexModule.callNative(
214
+ 'ijkLinkApi',
215
+ {
216
+ method: 'seek',
217
+ name: this.embedId,
218
+ params
219
+ },
220
+ callback
221
+ );
222
+ },
189
223
  captureImage(params,callback) {
190
224
  delete params.refId
191
225
  weexModule.callNative(
@@ -267,6 +301,9 @@ export default {
267
301
  },
268
302
  onCaptureCompletion(res){
269
303
  this.$emit('onCaptureCompletion', res);
304
+ },
305
+ onPlayerClick(res){
306
+ this.$emit('onPlayerClick', res);
270
307
  }
271
308
  },
272
309
  destroy(){
@@ -1,5 +1,6 @@
1
1
  <template>
2
2
  <BaseSameLayer
3
+ ref="baseSameLayer"
3
4
  :hosSameLayerArgs="hosSameLayerArgs"
4
5
  embedType="native/midea-progresscycle-view"
5
6
  :defaultWidth="300"
@@ -10,6 +11,7 @@
10
11
 
11
12
  <script>
12
13
  import BaseSameLayer from "./baseSameLayer.vue";
14
+ const weexModule = weex.requireModule('weexModule');
13
15
 
14
16
  export default {
15
17
  name: "MideaProgresscycleView",
@@ -17,7 +19,9 @@ export default {
17
19
  return {
18
20
  width: 0,
19
21
  height: 0,
20
- dataVersion: 0
22
+ dataVersion: 0,
23
+ observer: null,
24
+ isVisible: false
21
25
  }
22
26
  },
23
27
  components: {
@@ -70,12 +74,75 @@ export default {
70
74
  mounted() {
71
75
  this.width = this.$el.clientWidth;
72
76
  this.height = this.$el.clientHeight;
77
+
78
+ // 初始化可见性监听
79
+ this.observeVisibility();
80
+ },
81
+ beforeDestroy() {
82
+ // 销毁前清除观察器
83
+ if (this.observer) {
84
+ this.observer.disconnect();
85
+ this.observer = null;
86
+ }
73
87
  },
74
88
 
75
89
  methods: {
76
90
  handleProgresscycleTap (res){
77
91
  this.$emit("progresscycleTap", res);
78
92
  },
93
+
94
+ /**
95
+ * 初始化可见性监听
96
+ * 使用 IntersectionObserver API 监听组件是否进入可见区域
97
+ */
98
+ observeVisibility() {
99
+ // 检查浏览器是否支持 IntersectionObserver
100
+ if (!window.IntersectionObserver) {
101
+ console.warn('[MideaProgresscycleView] IntersectionObserver is not supported');
102
+ return;
103
+ }
104
+
105
+ const options = {
106
+ root: null, // 相对于视口
107
+ rootMargin: '0px', // 不设置边距
108
+ threshold: 0.1 // 当至少 10% 的元素可见时触发
109
+ };
110
+
111
+ this.observer = new IntersectionObserver((entries) => {
112
+ entries.forEach((entry) => {
113
+ if (entry.isIntersecting) {
114
+ // 组件进入可见区域
115
+ this.onVisibilityChange(true);
116
+ } else {
117
+ // 组件离开可见区域
118
+ this.onVisibilityChange(false);
119
+ }
120
+ });
121
+ }, options);
122
+
123
+ // 开始观察该组件
124
+ if (this.$el) {
125
+ this.observer.observe(this.$el);
126
+ }
127
+ },
128
+
129
+ /**
130
+ * 可见性变化回调函数
131
+ * @param {Boolean} isVisible - 是否可见
132
+ */
133
+ onVisibilityChange(isVisible) {
134
+ this.isVisible = isVisible;
135
+ // 通过 $refs 获取子组件 BaseSameLayer 的 embedId
136
+ const componentId = this.$refs.baseSameLayer.embedId;
137
+ weexModule.callNative(
138
+ 'GlobalApi',
139
+ {
140
+ method: 'visibleChange',
141
+ componentId: componentId,
142
+ isVisible
143
+ },
144
+ );
145
+ },
79
146
  },
80
147
  };
81
148
  </script>
@@ -0,0 +1,113 @@
1
+ <template>
2
+ <BaseSameLayer
3
+ :hosSameLayerArgs="hosSameLayerArgs"
4
+ embedType="native/midea-timeline-view"
5
+ :defaultWidth="300"
6
+ :defaultHeight="300"
7
+ >
8
+ </BaseSameLayer>
9
+ </template>
10
+
11
+ <script>
12
+ import BaseSameLayer from './baseSameLayer.vue';
13
+ const weexModule = weex.requireModule('weexModule');
14
+
15
+ export default {
16
+ data() {
17
+ return {
18
+ width: 0,
19
+ height: 0,
20
+ };
21
+ },
22
+ name: 'MideaTimelineView',
23
+ components: {
24
+ BaseSameLayer,
25
+ },
26
+ props: {
27
+ hosUniqueProps: {
28
+ type: Object,
29
+ default() {
30
+ return {};
31
+ },
32
+ },
33
+ data: {
34
+ type: Object,
35
+ default: () => {},
36
+ },
37
+ },
38
+ computed: {
39
+ hosSameLayerArgs() {
40
+ return {
41
+ ...this.hosUniqueProps, // 鸿蒙原生组件独有属性
42
+ width: this.width,
43
+ height: this.height,
44
+ data: this.data,
45
+ onBeginDragging: this.onBeginDragging,
46
+ onStopDragging: this.onStopDragging,
47
+ onBeginZooming: this.onBeginZooming,
48
+ onStopZooming: this.onStopZooming,
49
+ };
50
+ },
51
+ },
52
+ mounted() {
53
+ this.width = this.$el.clientWidth;
54
+ this.height = this.$el.clientHeight;
55
+ },
56
+
57
+ methods: {
58
+ enableUserInteraction(callback) {
59
+ weexModule.callNative(
60
+ 'timeLineApi',
61
+ {
62
+ method: 'enableUserInteraction',
63
+ name: this.embedId,
64
+ },
65
+ callback,
66
+ );
67
+ },
68
+ disableUserInteraction(callback) {
69
+ weexModule.callNative(
70
+ 'timeLineApi',
71
+ {
72
+ method: 'disableUserInteraction',
73
+ name: this.embedId,
74
+ },
75
+ callback,
76
+ );
77
+ },
78
+ updateCurrentTime(params,callback) {
79
+ weexModule.callNative(
80
+ 'timeLineApi',
81
+ {
82
+ method: 'updateCurrentTime',
83
+ name: this.embedId,
84
+ params
85
+ },
86
+ callback,
87
+ );
88
+ },
89
+ getCurrentTime(callback) {
90
+ weexModule.callNative(
91
+ 'timeLineApi',
92
+ {
93
+ method: 'getCurrentTime',
94
+ name: this.embedId,
95
+ },
96
+ callback,
97
+ );
98
+ },
99
+ onBeginDragging(data) {
100
+ this.$emit('onBeginDragging', data);
101
+ },
102
+ onStopDragging(data) {
103
+ this.$emit('onStopDragging', data);
104
+ },
105
+ onBeginZooming(data) {
106
+ this.$emit('onBeginZooming', data);
107
+ },
108
+ onStopZooming(data) {
109
+ this.$emit('onStopZooming', data);
110
+ },
111
+ },
112
+ };
113
+ </script>
package/src/index.js CHANGED
@@ -232,7 +232,12 @@ const componentMap = [
232
232
  },
233
233
  {
234
234
  componentName: 'mideaAudioInputView',
235
- componentAddress: 'midea-audio-input-view',
235
+ componentAddress: 'midea-audio-input-view.vue',
236
+ isInPlugin: false
237
+ },
238
+ {
239
+ componentName: 'MideaTimelineView',
240
+ componentAddress: 'midea-timeline-view.vue',
236
241
  isInPlugin: false
237
242
  },
238
243
  ]