Commit 69015503 authored by Steven杜宇's avatar Steven杜宇

// 视频播放URL包含中文问题

parent 3dc76668
......@@ -10,6 +10,7 @@ import UIKit
import AVFoundation
import AVKit
class YHSearchInfomationVC: YHBaseViewController {
static let searchInfoHistoryKey = "searchInfoHistoryKey"
......@@ -321,7 +322,7 @@ extension YHSearchInfomationVC: UITableViewDelegate, UITableViewDataSource {
if model.type == 1 { // 视频
if !model.media_url.isEmpty, let url = URL(string: model.media_url) {
let vc = YHVideoPlayerVC()
vc.url = model.media_url
vc.url = model.media_url.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)!
vc.id = model.id
self.navigationController?.pushViewController(vc)
}
......
......@@ -94,7 +94,7 @@ extension YHHomeCollectionViewCell {
if listModel.media_url.isEmpty == false,let url = URL(string: listModel.media_url) {
let vc = YHVideoPlayerVC()
vc.url = listModel.media_url
vc.url = listModel.media_url.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)!
vc.id = listModel.id
vc.updateBlock = {
[weak self] item in
......
......@@ -267,7 +267,7 @@ extension YHVideoPlayerVC {
}
let title: String = self.viewModel.mainModel?.title ?? ""
let link:String = self.viewModel.mainModel?.media_url ?? ""
let link:String = self.viewModel.mainModel?.media_url.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed) ?? ""
let thumbUrl = self.viewModel.mainModel?.img_url ?? ""
if thumbUrl.isEmpty {
YHHUD.flash(message:"分享失败")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment