Commit 60b4c0eb authored by Steven杜宇's avatar Steven杜宇

// 视频转码相关

parent a5d2ee57
...@@ -381,7 +381,11 @@ extension YHSearchInfomationVC: UITableViewDelegate, UITableViewDataSource { ...@@ -381,7 +381,11 @@ extension YHSearchInfomationVC: UITableViewDelegate, UITableViewDataSource {
if model.type == 1 { // 视频 if model.type == 1 { // 视频
if !model.media_url.isEmpty, let url = URL(string: model.media_url) { if !model.media_url.isEmpty, let url = URL(string: model.media_url) {
let vc = YHVideoPlayerVC() let vc = YHVideoPlayerVC()
vc.url = model.media_url if !model.media_transcode_url.isEmpty {
vc.url = model.media_transcode_url
} else {
vc.url = model.media_url
}
vc.id = model.id vc.id = model.id
self.navigationController?.pushViewController(vc) self.navigationController?.pushViewController(vc)
} }
......
...@@ -23,6 +23,8 @@ class YHHomeListModel: YHBaseModel { ...@@ -23,6 +23,8 @@ class YHHomeListModel: YHBaseModel {
var type: Int = 0 //文章类型 '文章类型 1视频 2图文 3图片', var type: Int = 0 //文章类型 '文章类型 1视频 2图文 3图片',
var is_like : Bool = false var is_like : Bool = false
var media_url : String = "" var media_url : String = ""
var media_transcode_url: String = ""
var like_count : Int = 0 //点赞梳理 var like_count : Int = 0 //点赞梳理
var img_url_compress : String = "" var img_url_compress : String = ""
......
...@@ -95,7 +95,11 @@ extension YHHomeCollectionViewCell { ...@@ -95,7 +95,11 @@ extension YHHomeCollectionViewCell {
printLog(url) printLog(url)
let vc = YHVideoPlayerVC() let vc = YHVideoPlayerVC()
vc.url = listModel.media_url if !listModel.media_transcode_url.isEmpty {
vc.url = listModel.media_transcode_url
} else {
vc.url = listModel.media_url
}
vc.id = listModel.id vc.id = listModel.id
vc.updateBlock = { vc.updateBlock = {
[weak self] item in [weak self] item in
......
...@@ -291,7 +291,10 @@ extension YHVideoPlayerVC { ...@@ -291,7 +291,10 @@ extension YHVideoPlayerVC {
} }
let title: String = self.viewModel.mainModel?.title ?? "" let title: String = self.viewModel.mainModel?.title ?? ""
let link:String = self.viewModel.mainModel?.media_url ?? "" var link:String = ""
if !url.isEmpty {
link = url
}
let thumbUrl = self.viewModel.mainModel?.img_url ?? "" let thumbUrl = self.viewModel.mainModel?.img_url ?? ""
if thumbUrl.isEmpty { if thumbUrl.isEmpty {
YHHUD.flash(message:"分享失败") 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