Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool
Showing
8 changed files
with
95 additions
and
44 deletions
| @@ -13,6 +13,7 @@ import { CommonConstants } from 'wdConstant/Index'; | @@ -13,6 +13,7 @@ import { CommonConstants } from 'wdConstant/Index'; | ||
| 13 | import { ProcessUtils } from 'wdRouter/Index'; | 13 | import { ProcessUtils } from 'wdRouter/Index'; |
| 14 | import { TrackConstants, TrackingButton, TrackingPageBrowse } from 'wdTracking/Index'; | 14 | import { TrackConstants, TrackingButton, TrackingPageBrowse } from 'wdTracking/Index'; |
| 15 | import inputMethod from '@ohos.inputMethod'; | 15 | import inputMethod from '@ohos.inputMethod'; |
| 16 | +import { photoPickerUtils } from '../utils/PhotoPickerUtils'; | ||
| 16 | 17 | ||
| 17 | const TAG = 'FeedBackActivity' | 18 | const TAG = 'FeedBackActivity' |
| 18 | 19 | ||
| @@ -163,15 +164,15 @@ export struct FeedBackActivity { | @@ -163,15 +164,15 @@ export struct FeedBackActivity { | ||
| 163 | GridCol({ | 164 | GridCol({ |
| 164 | }) { | 165 | }) { |
| 165 | if(1 == feedbackImageItem.itemType){ | 166 | if(1 == feedbackImageItem.itemType){ |
| 166 | - // Image($r('app.media.feekback_add')) | ||
| 167 | - // .width(60) | ||
| 168 | - // .height(60) | ||
| 169 | - // .onClick(async (event: ClickEvent) => { | ||
| 170 | - // if(await FastClickUtil.isMinDelayTime()){ | ||
| 171 | - // return | ||
| 172 | - // } | ||
| 173 | - // this.callFilePickerSelectImage(); | ||
| 174 | - // }) | 167 | + Image($r('app.media.feekback_add')) |
| 168 | + .width(60) | ||
| 169 | + .height(60) | ||
| 170 | + .onClick(async (event: ClickEvent) => { | ||
| 171 | + if(await FastClickUtil.isMinDelayTime()){ | ||
| 172 | + return | ||
| 173 | + } | ||
| 174 | + this.callFilePickerSelectImage(); | ||
| 175 | + }) | ||
| 175 | }else{ | 176 | }else{ |
| 176 | Stack({alignContent: Alignment.TopEnd}) { | 177 | Stack({alignContent: Alignment.TopEnd}) { |
| 177 | Image(feedbackImageItem.picPath) | 178 | Image(feedbackImageItem.picPath) |
| @@ -347,20 +348,9 @@ export struct FeedBackActivity { | @@ -347,20 +348,9 @@ export struct FeedBackActivity { | ||
| 347 | async callFilePickerSelectImage(): Promise<void> { // async 用于申明一个 function 是异步的 | 348 | async callFilePickerSelectImage(): Promise<void> { // async 用于申明一个 function 是异步的 |
| 348 | let array: string[]; | 349 | let array: string[]; |
| 349 | try { | 350 | try { |
| 350 | - // 设置photoPicker的参数 | ||
| 351 | - let PhotoSelectOptions = new picker.PhotoSelectOptions(); | ||
| 352 | - PhotoSelectOptions.MIMEType = picker.PhotoViewMIMETypes.IMAGE_TYPE; // 过滤选择媒体文件类型 | ||
| 353 | - let max = 3-this.pics.length+1 | ||
| 354 | - PhotoSelectOptions.maxSelectNumber = max; // 选择媒体文件的最大数目 | ||
| 355 | let mediaFlag = false; | 351 | let mediaFlag = false; |
| 356 | - let photoPicker = new picker.PhotoViewPicker(); // 使用图库选择器对象前,需要先创建PhotoViewPicker实例 | ||
| 357 | - photoPicker.select(PhotoSelectOptions).then((PhotoSelectResult) => { | ||
| 358 | - Logger.info(TAG, 'PhotoViewPicker.select successfully, PhotoSelectResult uri: ' + JSON.stringify(PhotoSelectResult)); // 日志中记录成功信息 | ||
| 359 | - if (PhotoSelectResult !== null && PhotoSelectResult !== undefined) { // 接口采用callback异步返回形式,返回PhotoSelectResult对象,故进行下一步操作前要先判断是否已经成功返回PhotoSelectResult对象了 | ||
| 360 | - | ||
| 361 | - // PhotoSelectResult为返回的结果集。 | ||
| 362 | - // 其中包含Array<string>类型的photoUris,为返回图库选择后的媒体文件的uri数组;还包含boolean类型的isOriginalPhoto,指示返回图库选择后的媒体文件是否为原图。 | ||
| 363 | - // 声明变量array,其取值为PhotoSelectResult中的数组。 | 352 | + photoPickerUtils.getPhotoPicker(3).then(PhotoSelectResult => { |
| 353 | + if (PhotoSelectResult) { | ||
| 364 | array = PhotoSelectResult['photoUris']; | 354 | array = PhotoSelectResult['photoUris']; |
| 365 | let beforeLen = this.pics.length + array.length; | 355 | let beforeLen = this.pics.length + array.length; |
| 366 | let totalLen = this.pics.length+array.length; | 356 | let totalLen = this.pics.length+array.length; |
| @@ -396,9 +386,6 @@ export struct FeedBackActivity { | @@ -396,9 +386,6 @@ export struct FeedBackActivity { | ||
| 396 | this.getFilenameByUriForMedia(array); | 386 | this.getFilenameByUriForMedia(array); |
| 397 | } | 387 | } |
| 398 | }) | 388 | }) |
| 399 | - .catch((err: BusinessError) => { | ||
| 400 | - Logger.error(TAG, 'PhotoViewPicker.select failed with err: ' + JSON.stringify(err)); | ||
| 401 | - }); | ||
| 402 | } catch (err) { | 389 | } catch (err) { |
| 403 | Logger.error(TAG, 'PhotoViewPicker failed with err: ' + err); | 390 | Logger.error(TAG, 'PhotoViewPicker failed with err: ' + err); |
| 404 | } | 391 | } |
| @@ -7,7 +7,7 @@ import {AreaPickerDialog} from '../view/areaPickerDialog/AreaPickerDialog' | @@ -7,7 +7,7 @@ import {AreaPickerDialog} from '../view/areaPickerDialog/AreaPickerDialog' | ||
| 7 | import {EditUserInfoCustomDialog} from '../view/areaPickerDialog/EditUserInfoCustomDialog' | 7 | import {EditUserInfoCustomDialog} from '../view/areaPickerDialog/EditUserInfoCustomDialog' |
| 8 | import {EditUserSexCustomDialog} from '../view/areaPickerDialog/EditUserSexCustomDialog' | 8 | import {EditUserSexCustomDialog} from '../view/areaPickerDialog/EditUserSexCustomDialog' |
| 9 | import {CustomDialogUI} from '../view/areaPickerDialog/CustomDialogUI' | 9 | import {CustomDialogUI} from '../view/areaPickerDialog/CustomDialogUI' |
| 10 | -import {AreaListModel } from '../../model/AreaListModel'; | 10 | +import { AreaListManageModel, AreaListModel } from '../../model/AreaListModel'; |
| 11 | import router from '@ohos.router'; | 11 | import router from '@ohos.router'; |
| 12 | import TrackingPageBrowseUtils from '../../utils/TrackingPageBrowseUtils' | 12 | import TrackingPageBrowseUtils from '../../utils/TrackingPageBrowseUtils' |
| 13 | import { TrackConstants } from 'wdTracking/Index'; | 13 | import { TrackConstants } from 'wdTracking/Index'; |
| @@ -34,11 +34,16 @@ struct EditUserInfoPage { | @@ -34,11 +34,16 @@ struct EditUserInfoPage { | ||
| 34 | 34 | ||
| 35 | dialogController: CustomDialogController = new CustomDialogController({ | 35 | dialogController: CustomDialogController = new CustomDialogController({ |
| 36 | builder: AreaPickerDialog({dataSource:this.dataSource,firstSelect:this.firstSelect,secondSelect:this.secondSelect,thirdSelect:this.thirdSelect, | 36 | builder: AreaPickerDialog({dataSource:this.dataSource,firstSelect:this.firstSelect,secondSelect:this.secondSelect,thirdSelect:this.thirdSelect, |
| 37 | - confirmCallback:(province:string,city:string,county:string,address:string)=>{ | ||
| 38 | - this.currentUserInfo.userExtend.province = province; | ||
| 39 | - this.currentUserInfo.userExtend.city = city; | ||
| 40 | - this.currentUserInfo.userExtend.county = county; | 37 | + confirmCallback:(province:AreaListManageModel,city:AreaListManageModel,county:AreaListManageModel,address:string)=>{ |
| 38 | + this.currentUserInfo.userExtend.province = province.label; | ||
| 39 | + this.currentUserInfo.userExtend.city = city.label; | ||
| 40 | + this.currentUserInfo.userExtend.county = county.label; | ||
| 41 | this.currentUserInfo.userExtend.address = address; | 41 | this.currentUserInfo.userExtend.address = address; |
| 42 | + | ||
| 43 | + this.currentUserInfo.userExtend.provinceCode = province.code; | ||
| 44 | + this.currentUserInfo.userExtend.cityCode = city.code; | ||
| 45 | + this.currentUserInfo.userExtend.districtCode = county.code; | ||
| 46 | + | ||
| 42 | this.currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_region | 47 | this.currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_region |
| 43 | this.updateEditModel() | 48 | this.updateEditModel() |
| 44 | this.getAreaIndex() | 49 | this.getAreaIndex() |
| @@ -93,9 +98,9 @@ struct EditUserInfoPage { | @@ -93,9 +98,9 @@ struct EditUserInfoPage { | ||
| 93 | 98 | ||
| 94 | pickerSelect(index:number){ | 99 | pickerSelect(index:number){ |
| 95 | if (index === 0) { | 100 | if (index === 0) { |
| 96 | - photoPickerUtils.getPhotoPicker().then(value => { | ||
| 97 | - if (value.length > 0) { | ||
| 98 | - this.headerImg = value | 101 | + photoPickerUtils.getPhotoPicker(1).then(value => { |
| 102 | + if (value) { | ||
| 103 | + this.headerImg = value['photoUris'][0] | ||
| 99 | } | 104 | } |
| 100 | }) | 105 | }) |
| 101 | }else { | 106 | }else { |
| @@ -115,7 +120,6 @@ struct EditUserInfoPage { | @@ -115,7 +120,6 @@ struct EditUserInfoPage { | ||
| 115 | } | 120 | } |
| 116 | 121 | ||
| 117 | this.getAccountOwnerInfo() | 122 | this.getAccountOwnerInfo() |
| 118 | - this.getAreaList() | ||
| 119 | } | 123 | } |
| 120 | 124 | ||
| 121 | onPageShow(){ | 125 | onPageShow(){ |
| @@ -280,6 +284,7 @@ struct EditUserInfoPage { | @@ -280,6 +284,7 @@ struct EditUserInfoPage { | ||
| 280 | this.currentUserInfo = editModel as editModel; | 284 | this.currentUserInfo = editModel as editModel; |
| 281 | this.listData.push(...EditInfoViewModel.getEditListInfo(editModel)) | 285 | this.listData.push(...EditInfoViewModel.getEditListInfo(editModel)) |
| 282 | }); | 286 | }); |
| 287 | + this.getAreaList() | ||
| 283 | }else { | 288 | }else { |
| 284 | EditInfoViewModel.queryPeopleAccountOwnerInfo(getContext(this)).then((peopleItem) => { | 289 | EditInfoViewModel.queryPeopleAccountOwnerInfo(getContext(this)).then((peopleItem) => { |
| 285 | EditInfoViewModel.queryAccountOwnerInfo(getContext(this)).then((editM) => { | 290 | EditInfoViewModel.queryAccountOwnerInfo(getContext(this)).then((editM) => { |
| @@ -290,6 +295,7 @@ struct EditUserInfoPage { | @@ -290,6 +295,7 @@ struct EditUserInfoPage { | ||
| 290 | this.currentUserInfo = editM as editModel; | 295 | this.currentUserInfo = editM as editModel; |
| 291 | this.listData.push(...EditInfoViewModel.getEditListInfo(editM)) | 296 | this.listData.push(...EditInfoViewModel.getEditListInfo(editM)) |
| 292 | }); | 297 | }); |
| 298 | + this.getAreaList() | ||
| 293 | }); | 299 | }); |
| 294 | } | 300 | } |
| 295 | } | 301 | } |
| @@ -17,7 +17,7 @@ export struct AreaPickerDialog { | @@ -17,7 +17,7 @@ export struct AreaPickerDialog { | ||
| 17 | secondSelect:number = 0 | 17 | secondSelect:number = 0 |
| 18 | thirdSelect:number = 0 | 18 | thirdSelect:number = 0 |
| 19 | 19 | ||
| 20 | - confirmCallback: (province:string,city:string,county:string,address:string) => void = () => { | 20 | + confirmCallback: (province:AreaListManageModel,city:AreaListManageModel,county:AreaListManageModel,address:string) => void = () => { |
| 21 | 21 | ||
| 22 | } | 22 | } |
| 23 | 23 | ||
| @@ -43,7 +43,7 @@ export struct AreaPickerDialog { | @@ -43,7 +43,7 @@ export struct AreaPickerDialog { | ||
| 43 | Button('提交',{type:ButtonType.Normal}) | 43 | Button('提交',{type:ButtonType.Normal}) |
| 44 | .onClick(()=> { | 44 | .onClick(()=> { |
| 45 | this.controller.close() | 45 | this.controller.close() |
| 46 | - this.confirmCallback(this.currentFirst.label,this.currentSecondBean.label,this.currentThirdBean.label,this.currentFirst.label+this.currentSecondBean.label+this.currentThirdBean.label); | 46 | + this.confirmCallback(this.currentFirst,this.currentSecondBean,this.currentThirdBean,this.currentFirst.label+this.currentSecondBean.label+this.currentThirdBean.label); |
| 47 | }) | 47 | }) |
| 48 | .width(60) | 48 | .width(60) |
| 49 | .backgroundColor(0xffffff) | 49 | .backgroundColor(0xffffff) |
| @@ -39,11 +39,17 @@ export class EditInfoModel{ | @@ -39,11 +39,17 @@ export class EditInfoModel{ | ||
| 39 | address:string = '' | 39 | address:string = '' |
| 40 | //生日 | 40 | //生日 |
| 41 | birthday:string = '' | 41 | birthday:string = '' |
| 42 | + | ||
| 43 | + creatorId:string = '' | ||
| 42 | //性别 | 44 | //性别 |
| 43 | sex:number = 0 | 45 | sex:number = 0 |
| 44 | 46 | ||
| 45 | airec:number = 0 | 47 | airec:number = 0 |
| 46 | 48 | ||
| 49 | + districtCode:string = '' | ||
| 50 | + provinceCode:string = '' | ||
| 51 | + cityCode:string = '' | ||
| 52 | + | ||
| 47 | } | 53 | } |
| 48 | 54 | ||
| 49 | export class editModel{ | 55 | export class editModel{ |
| @@ -84,6 +90,14 @@ export interface editModelParams { | @@ -84,6 +90,14 @@ export interface editModelParams { | ||
| 84 | birthday?:string; | 90 | birthday?:string; |
| 85 | //性别 | 91 | //性别 |
| 86 | sex?:string; | 92 | sex?:string; |
| 93 | + | ||
| 94 | + ///人民号 | ||
| 95 | + name?: string; | ||
| 96 | + districtCode?:string; | ||
| 97 | + countryCode?:string; | ||
| 98 | + provinceCode?:string; | ||
| 99 | + cityCode?:string; | ||
| 100 | + creatorId?:string; | ||
| 87 | } | 101 | } |
| 88 | 102 | ||
| 89 | 103 |
| @@ -11,20 +11,20 @@ const PERMISSIONS: Array<Permissions> = [ | @@ -11,20 +11,20 @@ const PERMISSIONS: Array<Permissions> = [ | ||
| 11 | 11 | ||
| 12 | export class PhotoPickerUtils { | 12 | export class PhotoPickerUtils { |
| 13 | 13 | ||
| 14 | - async getPhotoPicker(){ | 14 | + async getPhotoPicker(maxSelectNumber:number){ |
| 15 | this.pickerPermissions() | 15 | this.pickerPermissions() |
| 16 | 16 | ||
| 17 | let PhotoSelectOptions = new picker.PhotoSelectOptions(); | 17 | let PhotoSelectOptions = new picker.PhotoSelectOptions(); |
| 18 | PhotoSelectOptions.MIMEType = picker.PhotoViewMIMETypes.IMAGE_TYPE; // 过滤选择媒体文件类型 | 18 | PhotoSelectOptions.MIMEType = picker.PhotoViewMIMETypes.IMAGE_TYPE; // 过滤选择媒体文件类型 |
| 19 | - PhotoSelectOptions.maxSelectNumber = 1; // 选择媒体文件的最大数目 | 19 | + PhotoSelectOptions.maxSelectNumber = maxSelectNumber; // 选择媒体文件的最大数目 |
| 20 | let photoPicker = new picker.PhotoViewPicker(); // 使用图库选择器对象前,需要先创建PhotoViewPicker实例 | 20 | let photoPicker = new picker.PhotoViewPicker(); // 使用图库选择器对象前,需要先创建PhotoViewPicker实例 |
| 21 | 21 | ||
| 22 | - return new Promise<string>((success, fail) => { | 22 | + return new Promise<picker.PhotoSelectResult>((success, fail) => { |
| 23 | photoPicker.select(PhotoSelectOptions).then((PhotoSelectResult) => { | 23 | photoPicker.select(PhotoSelectOptions).then((PhotoSelectResult) => { |
| 24 | if (PhotoSelectResult !== null && PhotoSelectResult !== | 24 | if (PhotoSelectResult !== null && PhotoSelectResult !== |
| 25 | undefined) { | 25 | undefined) { |
| 26 | // 接口采用callback异步返回形式,返回PhotoSelectResult对象,故进行下一步操作前要先判断是否已经成功返回PhotoSelectResult对象了 | 26 | // 接口采用callback异步返回形式,返回PhotoSelectResult对象,故进行下一步操作前要先判断是否已经成功返回PhotoSelectResult对象了 |
| 27 | - success(PhotoSelectResult['photoUris'][0]) | 27 | + success(PhotoSelectResult) |
| 28 | } | 28 | } |
| 29 | }) | 29 | }) |
| 30 | }) | 30 | }) |
| @@ -139,6 +139,8 @@ class EditInfoViewModel { | @@ -139,6 +139,8 @@ class EditInfoViewModel { | ||
| 139 | } | 139 | } |
| 140 | 140 | ||
| 141 | updateUserInfo(item:editModel):Promise<ResponseDTO> { | 141 | updateUserInfo(item:editModel):Promise<ResponseDTO> { |
| 142 | + | ||
| 143 | + if (item.userType === 1){ | ||
| 142 | if (item.editDataType == WDEditDataModelType.WDEditDataModelType_head) { | 144 | if (item.editDataType == WDEditDataModelType.WDEditDataModelType_head) { |
| 143 | } else if (item.editDataType == WDEditDataModelType.WDEditDataModelType_nickname) { | 145 | } else if (item.editDataType == WDEditDataModelType.WDEditDataModelType_nickname) { |
| 144 | this.params = { userName: item.userName } | 146 | this.params = { userName: item.userName } |
| @@ -171,6 +173,41 @@ class EditInfoViewModel { | @@ -171,6 +173,41 @@ class EditInfoViewModel { | ||
| 171 | promptAction.showToast({ message: error.message }) | 173 | promptAction.showToast({ message: error.message }) |
| 172 | }) | 174 | }) |
| 173 | }) | 175 | }) |
| 176 | + }else { | ||
| 177 | + let url = '' | ||
| 178 | + if (item.editDataType == WDEditDataModelType.WDEditDataModelType_head) { | ||
| 179 | + url = '/api/rmrb-creator-user/c/rmrb-creator-user/creator/updateIcon' | ||
| 180 | + } else if (item.editDataType == WDEditDataModelType.WDEditDataModelType_nickname) { | ||
| 181 | + this.params = { name: item.userName} | ||
| 182 | + url = '/api/rmrb-creator-user/c/rmrb-creator-user/creator/updateName' | ||
| 183 | + } else if (item.editDataType == WDEditDataModelType.WDEditDataModelType_intro) { | ||
| 184 | + this.params = { introduction: item.userExtend.introduction } | ||
| 185 | + url = '/api/rmrb-creator-user/c/rmrb-creator-user/creator/updateIntroduction' | ||
| 186 | + } else if (item.editDataType == WDEditDataModelType.WDEditDataModelType_region) { | ||
| 187 | + this.params = {provinceCode:item.userExtend.provinceCode,cityCode:item.userExtend.cityCode, districtCode: item.userExtend.districtCode ,countryCode:'86'} | ||
| 188 | + url = '/api/rmrb-creator-user/c/rmrb-creator-user/creator/updateArea' | ||
| 189 | + } | ||
| 190 | + | ||
| 191 | + this.params.creatorId = item.userExtend.creatorId | ||
| 192 | + | ||
| 193 | + return new Promise((success, error) => { | ||
| 194 | + this.BasePostRequest(url,this.params) | ||
| 195 | + .then((navResDTO: ResponseDTO) => { | ||
| 196 | + if (navResDTO.code == 0) { | ||
| 197 | + promptAction.showToast({ message: '您的资料已提交' }) | ||
| 198 | + success(navResDTO) | ||
| 199 | + }else { | ||
| 200 | + promptAction.showToast({ message: navResDTO.message }) | ||
| 201 | + } | ||
| 202 | + }) | ||
| 203 | + .catch((error: Error) => { | ||
| 204 | + Logger.info(TAG,'updateUserInfo','EditInfoViewModel') | ||
| 205 | + promptAction.showToast({ message: error.message }) | ||
| 206 | + }) | ||
| 207 | + }) | ||
| 208 | + } | ||
| 209 | + | ||
| 210 | + | ||
| 174 | } | 211 | } |
| 175 | } | 212 | } |
| 176 | 213 |
| @@ -95,7 +95,7 @@ export class BackgroundAudioController { | @@ -95,7 +95,7 @@ export class BackgroundAudioController { | ||
| 95 | let metadata: AVSessionManager.AVMetadata = { | 95 | let metadata: AVSessionManager.AVMetadata = { |
| 96 | assetId: assetId.length > 0 ? assetId : "fake-asset-id", | 96 | assetId: assetId.length > 0 ? assetId : "fake-asset-id", |
| 97 | title: title.length > 0 ? title : " ", | 97 | title: title.length > 0 ? title : " ", |
| 98 | - mediaImage: pixelMapImage ?? ("file://" + mediaImage.id), | 98 | + mediaImage: "https://cdnjdphoto.aikan.pdnews.cn/WapApi/800/launcher_icon.png" ,//pixelMapImage ?? ("file://" + mediaImage.id), |
| 99 | artist: artist.length > 0 ? artist : "人日日报", | 99 | artist: artist.length > 0 ? artist : "人日日报", |
| 100 | duration: duration | 100 | duration: duration |
| 101 | }; | 101 | }; |
| @@ -155,11 +155,14 @@ export class BackgroundAudioController { | @@ -155,11 +155,14 @@ export class BackgroundAudioController { | ||
| 155 | 155 | ||
| 156 | //设置进度,单位ms | 156 | //设置进度,单位ms |
| 157 | async setSessionPlayProgress(progressDuration: number, totalDuration: number) { | 157 | async setSessionPlayProgress(progressDuration: number, totalDuration: number) { |
| 158 | + this.setSessionPlayProgressForce(progressDuration, totalDuration, false) | ||
| 159 | + } | ||
| 160 | + async setSessionPlayProgressForce(progressDuration: number, totalDuration: number, force: boolean) { | ||
| 158 | if (totalDuration <= 0) { | 161 | if (totalDuration <= 0) { |
| 159 | return | 162 | return |
| 160 | } | 163 | } |
| 161 | let newProgress = progressDuration / totalDuration | 164 | let newProgress = progressDuration / totalDuration |
| 162 | - if (Math.abs(newProgress - this.lastProgress) < 0.01) { | 165 | + if (force == false && Math.abs(newProgress - this.lastProgress) < 0.01) { |
| 163 | return | 166 | return |
| 164 | } | 167 | } |
| 165 | // Logger.debug(TAG, `set progress: ` + progressDuration + " duration: " + totalDuration); | 168 | // Logger.debug(TAG, `set progress: ` + progressDuration + " duration: " + totalDuration); |
| @@ -177,7 +180,7 @@ export class BackgroundAudioController { | @@ -177,7 +180,7 @@ export class BackgroundAudioController { | ||
| 177 | this.lastItemAssetId = undefined | 180 | this.lastItemAssetId = undefined |
| 178 | } | 181 | } |
| 179 | 182 | ||
| 180 | - if (this.hasSetupProgress) { | 183 | + if (force == false && this.hasSetupProgress) { |
| 181 | return | 184 | return |
| 182 | } | 185 | } |
| 183 | this.hasSetupProgress = true | 186 | this.hasSetupProgress = true |
| @@ -255,9 +258,9 @@ export class BackgroundAudioController { | @@ -255,9 +258,9 @@ export class BackgroundAudioController { | ||
| 255 | } else { | 258 | } else { |
| 256 | Logger.debug(TAG, `SetAVPlaybackState seek buffering`); | 259 | Logger.debug(TAG, `SetAVPlaybackState seek buffering`); |
| 257 | } | 260 | } |
| 258 | - | ||
| 259 | // 应用响应seek命令,使用应用内播放器完成seek实现 | 261 | // 应用响应seek命令,使用应用内播放器完成seek实现 |
| 260 | this.avplayerController?.setSeekMicroSecondsTime(position) | 262 | this.avplayerController?.setSeekMicroSecondsTime(position) |
| 263 | + this.setSessionPlayProgressForce(position, this.lastItemTotalDuration, true) | ||
| 261 | setTimeout(() => { | 264 | setTimeout(() => { |
| 262 | this.hasSetupProgress = false | 265 | this.hasSetupProgress = false |
| 263 | }, 1000) | 266 | }, 1000) |
| @@ -342,6 +342,10 @@ export class WDPlayerController { | @@ -342,6 +342,10 @@ export class WDPlayerController { | ||
| 342 | return; | 342 | return; |
| 343 | } | 343 | } |
| 344 | this.avPlayer?.seek(value); | 344 | this.avPlayer?.seek(value); |
| 345 | + | ||
| 346 | + if (this.status == PlayerConstants.STATUS_PAUSE) { | ||
| 347 | + this.avPlayer?.play() | ||
| 348 | + } | ||
| 345 | } | 349 | } |
| 346 | 350 | ||
| 347 | setBright() { | 351 | setBright() { |
-
Please register or login to post a comment