feat: 解决ios监控画面加载不出来bug

This commit is contained in:
fanpeng 2025-07-03 15:04:26 +08:00
parent b38e82907a
commit 026212c5b5
4 changed files with 146 additions and 131 deletions

View File

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
<key>NSAllowsArbitraryLoadsInWebContent</key>
<true/>
</dict>
</dict>
</plist>

View File

@ -1,74 +1,74 @@
{ {
"name" : "星星锁Lite", "name": "星星锁Lite",
"appid" : "__UNI__933D519", "appid": "__UNI__933D519",
"description" : "", "description": "",
"versionName" : "1.3.2", "versionName": "1.3.2",
"versionCode" : "39", "versionCode": "39",
"mp-weixin" : { "mp-weixin": {
"appid" : "wx9829a39e65550757", "appid": "wx9829a39e65550757",
"setting" : { "setting": {
"urlCheck" : true, "urlCheck": true,
"minified" : true "minified": true
}, },
"permission" : { "permission": {
"scope.bluetooth" : { "scope.bluetooth": {
"desc" : "蓝牙将用于控制和管理您的智能门锁" "desc": "蓝牙将用于控制和管理您的智能门锁"
} }
}, },
"usingComponents" : true, "usingComponents": true,
"lazyCodeLoading" : "requiredComponents", "lazyCodeLoading": "requiredComponents",
"optimization" : { "optimization": {
"subPackages" : true "subPackages": true
}, },
"plugins" : { "plugins": {
"wmpf-voip" : { "wmpf-voip": {
"version" : "latest", "version": "latest",
"provider" : "wxf830863afde621eb", "provider": "wxf830863afde621eb",
"genericsImplementation" : { "genericsImplementation": {
"call-page-plugin" : { "call-page-plugin": {
"custombox" : "pages/main/customBox" "custombox": "pages/main/customBox"
} }
} }
} }
} }
}, },
"vueVersion" : "3", "vueVersion": "3",
"app-plus" : { "app-plus": {
"distribute" : { "distribute": {
"icons" : { "icons": {
"android" : { "android": {
"hdpi" : "unpackage/res/icons/72x72.png", "hdpi": "unpackage/res/icons/72x72.png",
"xhdpi" : "unpackage/res/icons/96x96.png", "xhdpi": "unpackage/res/icons/96x96.png",
"xxhdpi" : "unpackage/res/icons/144x144.png", "xxhdpi": "unpackage/res/icons/144x144.png",
"xxxhdpi" : "unpackage/res/icons/192x192.png" "xxxhdpi": "unpackage/res/icons/192x192.png"
}, },
"ios" : { "ios": {
"appstore" : "unpackage/res/icons/1024x1024.png", "appstore": "unpackage/res/icons/1024x1024.png",
"ipad" : { "ipad": {
"app" : "unpackage/res/icons/76x76.png", "app": "unpackage/res/icons/76x76.png",
"app@2x" : "unpackage/res/icons/152x152.png", "app@2x": "unpackage/res/icons/152x152.png",
"notification" : "unpackage/res/icons/20x20.png", "notification": "unpackage/res/icons/20x20.png",
"notification@2x" : "unpackage/res/icons/40x40.png", "notification@2x": "unpackage/res/icons/40x40.png",
"proapp@2x" : "unpackage/res/icons/167x167.png", "proapp@2x": "unpackage/res/icons/167x167.png",
"settings" : "unpackage/res/icons/29x29.png", "settings": "unpackage/res/icons/29x29.png",
"settings@2x" : "unpackage/res/icons/58x58.png", "settings@2x": "unpackage/res/icons/58x58.png",
"spotlight" : "unpackage/res/icons/40x40.png", "spotlight": "unpackage/res/icons/40x40.png",
"spotlight@2x" : "unpackage/res/icons/80x80.png" "spotlight@2x": "unpackage/res/icons/80x80.png"
}, },
"iphone" : { "iphone": {
"app@2x" : "unpackage/res/icons/120x120.png", "app@2x": "unpackage/res/icons/120x120.png",
"app@3x" : "unpackage/res/icons/180x180.png", "app@3x": "unpackage/res/icons/180x180.png",
"notification@2x" : "unpackage/res/icons/40x40.png", "notification@2x": "unpackage/res/icons/40x40.png",
"notification@3x" : "unpackage/res/icons/60x60.png", "notification@3x": "unpackage/res/icons/60x60.png",
"settings@2x" : "unpackage/res/icons/58x58.png", "settings@2x": "unpackage/res/icons/58x58.png",
"settings@3x" : "unpackage/res/icons/87x87.png", "settings@3x": "unpackage/res/icons/87x87.png",
"spotlight@2x" : "unpackage/res/icons/80x80.png", "spotlight@2x": "unpackage/res/icons/80x80.png",
"spotlight@3x" : "unpackage/res/icons/120x120.png" "spotlight@3x": "unpackage/res/icons/120x120.png"
} }
} }
}, },
"android" : { "android": {
"permissions" : [ "permissions": [
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>", "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>", "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>", "<uses-permission android:name=\"android.permission.VIBRATE\"/>",
@ -94,21 +94,21 @@
"<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>", "<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>",
"<uses-permission android:name=\"android.permission.MANAGE_EXTERNAL_STORAGE\"/>" "<uses-permission android:name=\"android.permission.MANAGE_EXTERNAL_STORAGE\"/>"
], ],
"targetSdkVersion" : 34, "targetSdkVersion": 34,
"abiFilters" : [ "armeabi-v7a", "arm64-v8a" ] "abiFilters": ["armeabi-v7a", "arm64-v8a"]
}, },
"ios" : { "ios": {
"dSYMs" : false "dSYMs": false
} }
}, },
"modules" : { "modules": {
"Bluetooth" : {}, "Bluetooth": {},
"VideoPlayer" : {}, "VideoPlayer": {},
"Camera" : {}, "Camera": {},
"Record" : {} "Record": {}
}, },
"splashscreen" : { "splashscreen": {
"waiting" : false "waiting": false
} }
} }
} }

View File

@ -25,15 +25,16 @@
<!-- #ifdef APP-PLUS --> <!-- #ifdef APP-PLUS -->
<video <video
:key="videoKey"
autoplay autoplay
id="playerRef" id="playerRef"
v-if="url" v-if="url"
:muted="isMute" :muted="isMute"
:src="urlPrefix" :src="urlPrefix"
:advanced="advancedOptions"
object-fit="cover" object-fit="cover"
class="w-[100vw] h-[100vh]" class="w-[100vw] h-[100vh]"
:is-live="true" :is-live="true"
:play-strategy="2"
:controls="false" :controls="false"
:show-progress="false" :show-progress="false"
:show-fullscreen-btn="false" :show-fullscreen-btn="false"
@ -222,6 +223,25 @@
const isVoice = ref(false) const isVoice = ref(false)
const isMute = ref(false) const isMute = ref(false)
const isVideoLoaded = ref(false) const isVideoLoaded = ref(false)
const videoKey = ref(Date.now())
const advancedOptions = ref([
{
key: 'videotoolbox',
value: 0,
type: 'player'
},
{
key: 'framedrop',
value: 5,
type: 'player'
},
{
key: 'skip_loop_filter',
value: 48,
type: 'player'
}
])
const urlPrefix = computed(() => { const urlPrefix = computed(() => {
const data = const data =
@ -281,13 +301,15 @@
) )
console.log('初始化SDK结果', result) console.log('初始化SDK结果', result)
if (result?.code === 0) { if (result?.code === 0) {
handlePlaySuccess()
setTimeout(() => {
url.value = result.data.url url.value = result.data.url
runSendServiceFunction( runSendServiceFunction(
`${deviceInfo.value.productId}/${deviceInfo.value.deviceName}`, `${deviceInfo.value.productId}/${deviceInfo.value.deviceName}`,
'channel=0', 'channel=0',
true true
) )
handlePlaySuccess() }, 0)
} else { } else {
$basic.backAndToast(message) $basic.backAndToast(message)
} }
@ -317,7 +339,12 @@
uni.showActionSheet({ uni.showActionSheet({
itemList: range.value.map(item => item.name), itemList: range.value.map(item => item.name),
success: res => { success: res => {
index.value = res.tapIndex const value = res.tapIndex
if (index.value === value) {
return
}
index.value = value
videoKey.value = Date.now()
} }
}) })
} }

View File

@ -110,7 +110,8 @@ export const startServiceFunction = async function (
export const stopServiceFunction = async function (id: string): Promise<Result> { export const stopServiceFunction = async function (id: string): Promise<Result> {
try { try {
await stopService(id) const result = await stopService(id)
console.log('stopService', result)
return { return {
code: 0, code: 0,
data: {}, data: {},