杨锴
2024-11-15 745e4fc64ca2912c011d925f12e638ed6d81b367
XQMuse/Root/Course/View/CourseDetailHeaderView.swift
@@ -15,6 +15,10 @@
            @IBOutlet weak var label_studyNum: UILabel!
            @IBOutlet weak var image_cover: UIImageView!
            @IBOutlet weak var icon: UIImageView!
    private var videoView:VideoView?
            override func awakeFromNib() {
                        super.awakeFromNib()
            }
@@ -23,6 +27,15 @@
                        label_title.text = model.courseTitle
                        label_teacher.text = "导师 \(model.tutor)"
                        label_studyNum.text = "\(model.count)人已加入学习"
                        image_cover.sd_setImage(with: URL(string: model.coverUrl))
                        image_cover.sd_setImage(with: URL(string: model.detailUrl.jq_urlEncoded()))
            }
    func setVideo(url:String,coverImageUrl:String,delegate:CLPlayerDelegate){
        videoView = VideoView(url: url, autoPlay: false, placeHoderImageUrl: coverImageUrl, delegate: delegate)
        addSubview(videoView!)
        videoView!.snp.makeConstraints { make in
            make.edges.equalTo(self.image_cover)
        }
    }
}