diff --git a/harmony/rn_video.har b/harmony/rn_video.har index a34568d046..0cc7e19f98 100644 Binary files a/harmony/rn_video.har and b/harmony/rn_video.har differ diff --git a/harmony/rn_video/oh-package.json5 b/harmony/rn_video/oh-package.json5 index 8c09a9ff23..c4eaa8e68a 100644 --- a/harmony/rn_video/oh-package.json5 +++ b/harmony/rn_video/oh-package.json5 @@ -5,7 +5,7 @@ "name": "@react-native-oh-tpl/react-native-video", "description": "main cpai architecture", "main": "index.ets", - "version": "5.2.1-0.2.2", + "version": "5.2.1-0.2.4", "dependencies": { "@rnoh/react-native-openharmony": "file:../react_native_openharmony" } diff --git a/harmony/rn_video/src/main/ets/RNCVideo.ets b/harmony/rn_video/src/main/ets/RNCVideo.ets index fd08fac7ca..b670c52799 100644 --- a/harmony/rn_video/src/main/ets/RNCVideo.ets +++ b/harmony/rn_video/src/main/ets/RNCVideo.ets @@ -135,10 +135,10 @@ export struct RNCVideo { this.updatePropFromDesc() this.preparePlayer(); this.videoWidth = this.viewWidth - this.videoHeight = this.viewHeight + if(display.getDefaultDisplaySync().orientation == 0 || display.getDefaultDisplaySync().orientation == 2){ this.videoWidth = CommonConstants.FULL_PERCENT; - this.videoHeight = CommonConstants.FULL_PERCENT; + // this.videoHeight = CommonConstants.FULL_PERCENT; } @@ -180,6 +180,11 @@ export struct RNCVideo { this.muted = this.descriptor.props.muted this.paused = this.descriptor.props.paused this.resizeMode = this.descriptor.props.resizeMode + if(this.resizeMode === 'cover') + { + this.videoHeight = this.viewHeight + } + this.repeat = this.descriptor.props.repeat this.volume = this.descriptor.props.volume this.srcParam = this.descriptor.props.src.uri diff --git a/harmony/rn_video/src/main/ets/view/PlayPlayer.ets b/harmony/rn_video/src/main/ets/view/PlayPlayer.ets index 7afe702595..b609436692 100644 --- a/harmony/rn_video/src/main/ets/view/PlayPlayer.ets +++ b/harmony/rn_video/src/main/ets/view/PlayPlayer.ets @@ -146,6 +146,11 @@ export struct PlayPlayer { .width(this.videoWidth) .height(this.videoHeight) .scale(this.matrix) + .onVisibleAreaChange([0.0,1.0],(isVisble:boolean,currentRatio:number)=>{ + if(!isVisble && currentRatio <=1.0){ + this.playVideoModel.pause() + } + }) } .width(this.changedViewWidth) .height(this.changedviewHeight) diff --git a/package.json b/package.json index c4010396ff..49c46dea76 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@react-native-oh-tpl/react-native-video", - "version": "5.2.1-0.2.2", + "version": "5.2.1-0.2.4", "description": "A