@dolphinweex/weex-harmony 0.1.73 → 0.1.74

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.73",
3
+ "version": "0.1.74",
4
4
  "description": "weex harmony adapter",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -16,6 +16,7 @@
16
16
  left: 0,
17
17
  bottom: 0,
18
18
  right: 0,
19
+ zIndex: 1
19
20
  }
20
21
  "
21
22
  ></BaseSameLayer>
@@ -0,0 +1,240 @@
1
+ <template>
2
+ <BaseSameLayer
3
+ :hosSameLayerArgs="hosSameLayerArgs"
4
+ ref="sameLayer"
5
+ embedType="native/midea-ipc-ijkplayer-view"
6
+ :defaultWidth="'100%'"
7
+ :defaultHeight="'100%'"
8
+ :embedWidth="embedWidth"
9
+ :embedHeight="embedHeight"
10
+ :style="
11
+ embedPosition !== 'fixed'
12
+ ? { position: embedPosition }
13
+ : {
14
+ position: embedPosition,
15
+ top: 0,
16
+ left: 0,
17
+ bottom: 0,
18
+ right: 0,
19
+ zIndex: 1
20
+ }
21
+ "
22
+ ></BaseSameLayer>
23
+ </template>
24
+
25
+ <script>
26
+ import BaseSameLayer from './baseSameLayer.vue';
27
+
28
+ export default {
29
+ data() {
30
+ return {
31
+ width: 0,
32
+ height: 0,
33
+ embedWidth: '100%',
34
+ embedHeight: '100%',
35
+ embedPosition: 'static',
36
+ defaultWidth: '100%',
37
+ defaultHeight: '100%',
38
+ };
39
+ },
40
+ name: 'MideaIpcIjkplayerView',
41
+ components: {
42
+ BaseSameLayer,
43
+ },
44
+ props: {
45
+ hosUniqueProps: {
46
+ type: Object,
47
+ default() {
48
+ return {};
49
+ },
50
+ },
51
+ data: {
52
+ type: Object,
53
+ default() {
54
+ return {};
55
+ },
56
+ },
57
+ config: {
58
+ type: Object,
59
+ default() {
60
+ return {};
61
+ },
62
+ },
63
+ muted: {
64
+ type: Boolean,
65
+ default: false,
66
+ },
67
+ playStatus: {
68
+ type: String,
69
+ default: 'normal',
70
+ },
71
+ needDownload: {
72
+ type: Boolean,
73
+ default: false,
74
+ },
75
+ isSupportScale: {
76
+ type: Boolean,
77
+ default: false,
78
+ },
79
+ videoResize: {
80
+ type: Number,
81
+ default: 0,
82
+ },
83
+ autoplay: {
84
+ type: Boolean,
85
+ default: false,
86
+ },
87
+ videoCover: {
88
+ type: String,
89
+ default: '',
90
+ },
91
+ uiVisible: {
92
+ type: Object,
93
+ default() {
94
+ return {
95
+ voiceBtnVisible: true,
96
+ speedBtnVisible: true,
97
+ captureBtnVisible: true,
98
+ downloadBtnVisible: true,
99
+ batteryTimeLayoutVisible: false,
100
+ };
101
+ },
102
+ },
103
+ speedList: {
104
+ type: Array,
105
+ default() {
106
+ return ['0.5', '1', '1.5', '2'];
107
+ },
108
+ },
109
+ extraInfo: {
110
+ type: String,
111
+ default: '',
112
+ },
113
+ deleteBtnVisible: {
114
+ type: Number,
115
+ default: 0,
116
+ },
117
+ downloadDir: {
118
+ type: String,
119
+ default: '',
120
+ },
121
+ albumName: {
122
+ type: String,
123
+ default: '',
124
+ },
125
+ src: {
126
+ type: String,
127
+ default: '',
128
+ },
129
+ isShowTopRightViewOnPortrait: {
130
+ type: Boolean,
131
+ default: false,
132
+ },
133
+ },
134
+ computed: {
135
+ hosSameLayerArgs() {
136
+ return {
137
+ ...this.hosUniqueProps, // 鸿蒙原生组件独有属性
138
+ width: this.width,
139
+ height: this.height,
140
+ onFullscreenChange: this.onFullscreenChange,
141
+ // 视频播放器相关属性
142
+ config: this.config,
143
+ muted: this.muted,
144
+ playStatus: this.playStatus,
145
+ needDownload: this.needDownload,
146
+ isSupportScale: this.isSupportScale,
147
+ videoResize: this.videoResize,
148
+ autoplay: this.autoplay,
149
+ videoCover: this.videoCover,
150
+ uiVisible: this.uiVisible,
151
+ speedList: this.speedList,
152
+ extraInfo: this.extraInfo,
153
+ deleteBtnVisible: this.deleteBtnVisible,
154
+ downloadDir: this.downloadDir,
155
+ albumName: this.albumName,
156
+ data: this.data,
157
+ src: this.src,
158
+ isShowTopRightViewOnPortrait: this.isShowTopRightViewOnPortrait,
159
+
160
+ // 事件回调
161
+ onProgress: this.onProgress,
162
+ onStart: this.onStart,
163
+ onPause: this.onPause,
164
+ finish: this.finish,
165
+ onFail: this.onFail,
166
+ onReadyToPlay: this.onReadyToPlay,
167
+ deleteVideo: this.deleteVideo,
168
+ onDownloadSuccess: this.onDownloadSuccess,
169
+ onStartDownload: this.onStartDownload,
170
+ onPreviewImageClick: this.onPreviewImageClick,
171
+ };
172
+ },
173
+ },
174
+ mounted() {
175
+ this.width = this.$el.clientWidth;
176
+ this.height = this.$el.clientHeight;
177
+ this.windowWidth = window.innerWidth;
178
+ this.windowHeight = window.innerHeight;
179
+ this.$nextTick(() => {
180
+ this.defaultWidth = this.$refs.sameLayer.$el.clientWidth;
181
+ this.defaultHeight = this.$refs.sameLayer.$el.clientHeight;
182
+ this.defaultPosition =
183
+ this.$refs.sameLayer.$el.style.position || 'static';
184
+ });
185
+ },
186
+ methods: {
187
+ onFullscreenChange(isFullScreeen) {
188
+ if (isFullScreeen.flag) {
189
+ this.embedPosition = 'fixed';
190
+ this.embedHeight = this.windowWidth;
191
+ this.embedWidth = this.windowHeight;
192
+ } else {
193
+ this.embedPosition = this.defaultPosition;
194
+ this.embedHeight = this.defaultHeight;
195
+ this.embedWidth = this.defaultWidth;
196
+ }
197
+ },
198
+ // 自定义拓展其它逻辑
199
+ onProgress(res) {
200
+ this.$emit('onProgress', res);
201
+ },
202
+
203
+ onStart(res) {
204
+ this.$emit('onStart', res);
205
+ },
206
+
207
+ onPause(res) {
208
+ this.$emit('onPause', res);
209
+ },
210
+
211
+ finish(res) {
212
+ this.$emit('finish', res);
213
+ },
214
+
215
+ onFail(res) {
216
+ this.$emit('onFail', res);
217
+ },
218
+
219
+ onReadyToPlay(res) {
220
+ this.$emit('onReadyToPlay', res);
221
+ },
222
+
223
+ deleteVideo(res) {
224
+ this.$emit('deleteVideo', res);
225
+ },
226
+
227
+ onDownloadSuccess(res) {
228
+ this.$emit('onDownloadSuccess', res);
229
+ },
230
+
231
+ onStartDownload(res) {
232
+ this.$emit('onStartDownload', res);
233
+ },
234
+
235
+ onPreviewImageClick(res) {
236
+ this.$emit('onPreviewImageClick', res);
237
+ },
238
+ },
239
+ };
240
+ </script>
@@ -0,0 +1,195 @@
1
+ <template>
2
+ <BaseSameLayer
3
+ :hosSameLayerArgs="hosSameLayerArgs"
4
+ embedType="native/midea-ipc-live-view"
5
+ :defaultWidth="300"
6
+ :defaultHeight="300"
7
+ ></BaseSameLayer>
8
+ </template>
9
+
10
+ <script>
11
+ import BaseSameLayer from './baseSameLayer.vue';
12
+ const weexModule = weex.requireModule('weexModule');
13
+
14
+ export default {
15
+ data() {
16
+ return {
17
+ width: 0,
18
+ height: 0,
19
+ };
20
+ },
21
+ name: 'MideaIpcLiveView',
22
+ components: {
23
+ BaseSameLayer,
24
+ },
25
+ props: {
26
+ src: {
27
+ type: String,
28
+ default: '',
29
+ },
30
+ url: {
31
+ type: String,
32
+ default: '',
33
+ },
34
+ videoResize: {
35
+ // videoResize?: 0 | 1 | 2; // 0=Aspect,1=AspectFill,2=Resize(容器表现)
36
+ type: Number,
37
+ default: '',
38
+ },
39
+ autoplay: {
40
+ type: Boolean,
41
+ default: false,
42
+ },
43
+ videoCover: {
44
+ type: String,
45
+ default: '',
46
+ },
47
+ bottomShadow: {
48
+ type: Object,
49
+ default: () => {},
50
+ },
51
+ isSupportScale: {
52
+ type: Boolean,
53
+ default: false,
54
+ },
55
+ controls: {
56
+ type: Boolean,
57
+ default: false,
58
+ },
59
+ topShadow: {
60
+ type: Object,
61
+ default: () => {},
62
+ },
63
+ hosUniqueProps: {
64
+ type: Object,
65
+ default() {
66
+ return {};
67
+ },
68
+ },
69
+ data: {
70
+ type: Object,
71
+ default() {
72
+ return {};
73
+ },
74
+ },
75
+ },
76
+ computed: {
77
+ hosSameLayerArgs() {
78
+ return {
79
+ ...this.hosUniqueProps, // 鸿蒙原生组件独有属性
80
+ width: this.width,
81
+ height: this.height,
82
+ data: this.data,
83
+ src: this.src,
84
+ url: this.url,
85
+ videoResize: this.videoResize,
86
+ autoplay: this.autoplay,
87
+ videoCover: this.videoCover,
88
+ bottomShadow: this.bottomShadow,
89
+ isSupportScale: this.isSupportScale,
90
+ controls: this.controls,
91
+ topShadow: this.topShadow,
92
+ hosUniqueProps: this.hosUniqueProps,
93
+ onPlayerClick: this.onPlayerClick,
94
+ onMoveControl: this.onMoveControl,
95
+ onScaleControl: this.onScaleControl,
96
+ onMoveEnd: this.onMoveEnd,
97
+ onStatePrepared: this.onStatePrepared,
98
+ onAutoCompletion: this.onAutoCompletion,
99
+ onStateAutoComplete: this.onStateAutoComplete,
100
+ };
101
+ },
102
+ },
103
+ mounted() {
104
+ this.width = this.$el.clientWidth;
105
+ this.height = this.$el.clientHeight;
106
+ },
107
+ watch:{
108
+ url(newV){
109
+ console.log('cdj-------------url',newV)
110
+ }
111
+ },
112
+ methods: {
113
+ switchVideoQuality(params,callback) {
114
+ weexModule.callNative(
115
+ 'ipcLinkApi',
116
+ {
117
+ method: 'switchVideoQuality',
118
+ name: this.embedId,
119
+ params
120
+ },
121
+ callback
122
+ );
123
+ },
124
+ getVideoNetworkSpeed(params,callback) {
125
+ weexModule.callNative(
126
+ 'ipcLinkApi',
127
+ {
128
+ method: 'getVideoNetworkSpeed',
129
+ name: this.embedId,
130
+ params
131
+ },
132
+ callback
133
+ );
134
+ },
135
+ startRecord(params,callback) {
136
+ weexModule.callNative(
137
+ 'ipcLinkApi',
138
+ {
139
+ method: 'startRecord',
140
+ name: this.embedId,
141
+ params
142
+ },
143
+ callback
144
+ );
145
+ },
146
+ stopRecord(params,callback) {
147
+ weexModule.callNative(
148
+ 'ipcLinkApi',
149
+ {
150
+ method: 'stopRecord',
151
+ name: this.embedId,
152
+ params
153
+ },
154
+ callback
155
+ );
156
+ },
157
+ changeAudioStatus(params,callback){
158
+ weexModule.callNative(
159
+ 'ipcLinkApi',
160
+ {
161
+ method: 'changeAudioStatus',
162
+ name: this.embedId,
163
+ params
164
+ },
165
+ callback
166
+ );
167
+ },
168
+ // 自定义拓展其它逻辑
169
+ onPlayerClick(res) {
170
+ this.$emit('onPlayerClick', res);
171
+ },
172
+
173
+ onMoveControl(res) {
174
+ this.$emit('onMoveControl', res);
175
+ },
176
+
177
+ onScaleControl(res) {
178
+ this.$emit('onScaleControl', res);
179
+ },
180
+
181
+ onMoveEnd(res) {
182
+ this.$emit('onMoveEnd', res);
183
+ },
184
+ onStatePrepared() {
185
+ this.$emit('onStatePrepared');
186
+ },
187
+ onAutoCompletion() {
188
+ this.$emit('onAutoCompletion');
189
+ },
190
+ onStateAutoComplete() {
191
+ this.$emit('onStateAutoComplete');
192
+ },
193
+ },
194
+ };
195
+ </script>
package/src/index.js CHANGED
@@ -74,11 +74,21 @@ const componentMap = [
74
74
  componentAddress: 'midea-ijkplayer-view.vue',
75
75
  isInPlugin: false
76
76
  },
77
+ {
78
+ componentName: 'MideaIpcIjkplayerView',
79
+ componentAddress: 'midea-ipc-ijkplayer-view',
80
+ isInPlugin: false
81
+ },
77
82
  {
78
83
  componentName: 'MideaIotlinkvideoView',
79
84
  componentAddress: 'midea-iotlinkvideo-view.vue',
80
85
  isInPlugin: false
81
86
  },
87
+ {
88
+ componentName: 'MideaIpcLiveView',
89
+ componentAddress: 'midea-ipc-live-view.vue',
90
+ isInPlugin: false
91
+ },
82
92
  {
83
93
  componentName: 'MideaSeekBar',
84
94
  componentAddress: 'midea-seek-bar-base.vue',