Commit c84c68b656fd794bc39e0c27b69afdf3a5263f6a

Authored by 张旭
1 parent 0d2060c3

修复看点视频调整分辨率后播放付费视频内容的问题

metaCode/Classes/Main/HuBiLieHomePage/Controller/CNLiveTVPlayerViewController.swift
... ... @@ -977,8 +977,7 @@ class CNLiveTVPlayerViewController:UIViewController, UITableViewDataSource, UITa
977 977 }
978 978 self.controlView.controlGaoqingUpdateBlock = { [weak self] gaoqing in
979 979 guard let self = self else { return }
980   - //
981   -
  980 + //2024_30d7a67242dc48ee987235f5135ab30e
982 981 CNLiveHomePageViewModel.shared.getVodVideoURL(contentId: self.vodPlayModel?.contentId ?? "", rate: gaoqing) {[weak self] result, status in
983 982 guard let self = self else { return }
984 983 if status == .success{
... ... @@ -1218,37 +1217,65 @@ class CNLiveTVPlayerViewController:UIViewController, UITableViewDataSource, UITa
1218 1217 //单集有值-简介
1219 1218 var temp5Mdl:CNLiveVodPlayBlockListModel?
1220 1219 var temp2Mdl:CNLiveVodPlayBlockListModel?
1221   -
1222   - var tempVodPlayModel = self.vodPlayModel
  1220 +
  1221 + //新数据 查找新数据是否有2看点数据,没有插入
  1222 + var isContain2Model = false
1223 1223 for (_,vodMdl) in vodPlayModel.blockList.enumerated(){
1224 1224 if vodMdl.type == "5"{
1225 1225 temp5Mdl = vodMdl
1226 1226 }
1227 1227 if vodMdl.type == "2"{
1228 1228 temp2Mdl = vodMdl
  1229 + isContain2Model = true
  1230 + }else{
  1231 +
  1232 + }
  1233 + }
  1234 + if !isContain2Model{
  1235 + //增加2 block
  1236 + var blockList2Model = CNLiveVodPlayBlockListModel()
  1237 + blockList2Model.list = [CNLiveVodPlayBlockListListModel]()
  1238 + blockList2Model.type = "2"
  1239 + blockList2Model.name = "看点"
  1240 + vodPlayModel.blockList.append(blockList2Model)
  1241 + }else{
  1242 + print("111")
  1243 + }
  1244 + var tempVodPlayModel = vodPlayModel
  1245 +
  1246 + //旧看点的model
  1247 + var tempKandian2Mdl:CNLiveVodPlayBlockListModel?
  1248 + for (_,vodMdl) in self.vodPlayModel!.blockList.enumerated(){
  1249 + if vodMdl.type == "2"{
  1250 + tempKandian2Mdl = vodMdl
1229 1251 }
1230 1252 }
1231   - for(index,vodModel) in tempVodPlayModel!.blockList.enumerated(){
  1253 +
  1254 + for(index,vodModel) in tempVodPlayModel.blockList.enumerated(){
1232 1255 if self.isPlayAblumOrKandian{
1233 1256 //切换剧集时, 调用play接口, 更新片花列表和商品列表
1234 1257 if temp2Mdl != nil{
1235 1258 if vodModel.type == "2"{//更新片花
1236   - tempVodPlayModel!.blockList[index] = temp2Mdl!
  1259 + tempVodPlayModel.blockList[index] = temp2Mdl!
1237 1260 }
1238 1261 }
1239 1262  
1240 1263 }else{
1241 1264 //切换看点时, 调用play接口, 只更新商品列表
  1265 + //替换看点列表为旧数据
  1266 + if vodModel.type == "2"{
  1267 + tempVodPlayModel.blockList[index] = tempKandian2Mdl ?? CNLiveVodPlayBlockListModel()
  1268 + }
1242 1269 }
1243 1270  
1244 1271 //更新简介里的 点赞和收藏 简介
1245 1272 if temp5Mdl != nil{
1246 1273 if vodModel.type == "5"{
1247   - tempVodPlayModel!.blockList[index] = temp5Mdl!
  1274 + tempVodPlayModel.blockList[index] = temp5Mdl!
1248 1275 }
1249 1276 }
1250 1277 }
1251   - tempVodPlayModel?.goodsJson = vodPlayModel.goodsJson
  1278 + tempVodPlayModel.goodsJson = vodPlayModel.goodsJson
1252 1279 self.vodPlayModel = tempVodPlayModel
1253 1280 self.controlView.vodPlayModel = tempVodPlayModel
1254 1281  
... ...