修复ios视频无法播放的bug

This commit is contained in:
weipengfei 2024-03-04 13:48:13 +08:00
parent c12e93afa1
commit 90cb3619f5
3 changed files with 22 additions and 12 deletions

View File

@ -2,16 +2,16 @@
"name" : "养殖溯源", "name" : "养殖溯源",
"appid" : "__UNI__C509A32", "appid" : "__UNI__C509A32",
"description" : "", "description" : "",
"versionName" : "1.0.2", "versionName" : "1.0.3",
"versionCode" : 102, "versionCode" : 103,
"transformPx" : false, "transformPx" : false,
/* 5+App */ /* 5+App */
"app-plus" : { "app-plus" : {
"usingComponents" : true, "usingComponents" : true,
"nvueStyleCompiler" : "uni-app", "nvueStyleCompiler" : "uni-app",
"compilerVersion" : 3, "compilerVersion" : 3,
"compatible":{ "compatible" : {
"ignoreVersion": true //trueHBuilderX1.9.0 "ignoreVersion" : true //trueHBuilderX1.9.0
}, },
"screenOrientation" : [ "screenOrientation" : [
"portrait-primary", "portrait-primary",

View File

@ -35,20 +35,30 @@
onLoad(option) { onLoad(option) {
this.deviceId = option.device this.deviceId = option.device
this.videoUrl = option.url this.videoUrl = option.url
this.videoUrl = this.replaceLastThreeChars(this.videoUrl, "mp4");
this.subNvue = uni.getSubNVueById('subNvueIos'); //获取 this.subNvue = uni.getSubNVueById('subNvueIos'); //获取
let datas = { // let datas = {
username: option.user, // username: option.user,
device: 'lihai_lot_walnutpi_dev_' + option.device, // device: 'lihai_lot_walnutpi_dev_' + option.device,
scene: 'app', // scene: 'app',
} // }
this.openScoket(datas) // this.openScoket(datas)
let platform = uni.getSystemInfoSync() let platform = uni.getSystemInfoSync()
this.videoHeight = platform.windowHeight this.videoHeight = platform.windowHeight
this.videoWidth = platform.windowWidth this.videoWidth = platform.windowWidth
this.videoOffset = platform.screenHeight - platform.windowHeight + platform.statusBarHeight this.videoOffset = platform.screenHeight - platform.windowHeight + platform.statusBarHeight
this.shwovideo = true
}, },
methods: { methods: {
replaceLastThreeChars(str, replacement) {
if (str.length < 3) {
return replacement + str;
} else {
return str.slice(0, -3) + replacement;
}
},
openScoket(datas) { openScoket(datas) {
let that = this let that = this
this.SocketTask = uni.connectSocket({ this.SocketTask = uni.connectSocket({

View File

@ -7,8 +7,8 @@
"id": "__UNI__C509A32", "id": "__UNI__C509A32",
"name": "养殖溯源", "name": "养殖溯源",
"version": { "version": {
"name": "1.0.2", "name": "1.0.3",
"code": 102 "code": 103
}, },
"description": "", "description": "",
"developer": { "developer": {