清除无效代码
This commit is contained in:
parent
06e0b38c98
commit
f0528c6e7a
Binary file not shown.
@ -9,10 +9,6 @@ import Foundation
|
|||||||
import UIKit
|
import UIKit
|
||||||
import AVKit
|
import AVKit
|
||||||
|
|
||||||
//专门用于assetoutput资源释放的 线程控制
|
|
||||||
//let AssetGlobalQueue = DispatchQueue.global(qos: DispatchQoS.QoSClass.default)
|
|
||||||
//let CustomPlayerShareSemaphore = DispatchSemaphore(value: 1)
|
|
||||||
//let CustomPlayerShareRecursiveLock = NSRecursiveLock()
|
|
||||||
|
|
||||||
class ZZHCustomPlayer: UIView {
|
class ZZHCustomPlayer: UIView {
|
||||||
|
|
||||||
@ -28,17 +24,14 @@ class ZZHCustomPlayer: UIView {
|
|||||||
var assetReader:AVAssetReader?
|
var assetReader:AVAssetReader?
|
||||||
var assetOutput:AVAssetReaderTrackOutput? {
|
var assetOutput:AVAssetReaderTrackOutput? {
|
||||||
didSet {
|
didSet {
|
||||||
// custominstruction?.assetOutput = assetOutput
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// var custominstruction:ZZHCustomVideoCompositionInstruction?
|
|
||||||
|
|
||||||
let videoTranserConvertor = PlayByTransferConvertor()
|
let videoTranserConvertor = PlayByTransferConvertor()
|
||||||
var selectedIndex:SpatialType = .parallelEyes//记录当前选择的菜单选项
|
var selectedIndex:SpatialType = .parallelEyes//记录当前选择的菜单选项
|
||||||
{
|
{
|
||||||
didSet{
|
didSet{
|
||||||
//进行相应解码操作,边解边播
|
//进行相应解码操作,边解边播
|
||||||
// custominstruction?.selectedIndex = selectedIndex
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -53,8 +46,6 @@ class ZZHCustomPlayer: UIView {
|
|||||||
var prePlayingState:Bool = true //标记 在滑块拖动前,player的播放状态,以便在拖动完毕之后回复播放状态
|
var prePlayingState:Bool = true //标记 在滑块拖动前,player的播放状态,以便在拖动完毕之后回复播放状态
|
||||||
let playerPauseBgColor:UIColor = UIColor(r: 20, g: 20, b: 20, a: 0.2)//暂停时的背景颜色
|
let playerPauseBgColor:UIColor = UIColor(r: 20, g: 20, b: 20, a: 0.2)//暂停时的背景颜色
|
||||||
|
|
||||||
//线程锁
|
|
||||||
// let lock = NSLock()
|
|
||||||
|
|
||||||
lazy var maskPlayerView:UIView? = {//播放按钮 背景
|
lazy var maskPlayerView:UIView? = {//播放按钮 背景
|
||||||
let bgView = UIView()
|
let bgView = UIView()
|
||||||
@ -114,7 +105,6 @@ class ZZHCustomPlayer: UIView {
|
|||||||
|
|
||||||
avPlayerLayer = AVPlayerLayer(player: avPlayer)
|
avPlayerLayer = AVPlayerLayer(player: avPlayer)
|
||||||
avPlayerLayer?.frame = CGRect(x: 0, y: 0, width: Int(playerWidth), height: playerHeight)
|
avPlayerLayer?.frame = CGRect(x: 0, y: 0, width: Int(playerWidth), height: playerHeight)
|
||||||
// avPlayerLayer?.backgroundColor = UIColor.red.cgColor
|
|
||||||
avPlayerLayer?.videoGravity = .resizeAspectFill
|
avPlayerLayer?.videoGravity = .resizeAspectFill
|
||||||
playerLayerBgView!.layer.addSublayer(avPlayerLayer!)
|
playerLayerBgView!.layer.addSublayer(avPlayerLayer!)
|
||||||
playerLayerBgView?.backgroundColor = UIColor.clear
|
playerLayerBgView?.backgroundColor = UIColor.clear
|
||||||
@ -140,7 +130,6 @@ class ZZHCustomPlayer: UIView {
|
|||||||
//通过slider进行seek播放时间点
|
//通过slider进行seek播放时间点
|
||||||
func manualToSeekPlay(value:Float,isMoving:Bool){
|
func manualToSeekPlay(value:Float,isMoving:Bool){
|
||||||
if isMoving {
|
if isMoving {
|
||||||
// self.play(false)
|
|
||||||
self.avPlayer?.pause()
|
self.avPlayer?.pause()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -159,7 +148,6 @@ class ZZHCustomPlayer: UIView {
|
|||||||
self.avPlayer?.seek(to: ct,toleranceBefore:.zero,toleranceAfter: .zero)
|
self.avPlayer?.seek(to: ct,toleranceBefore:.zero,toleranceAfter: .zero)
|
||||||
if(!isMoving) {//结束拖动时,再进行播放
|
if(!isMoving) {//结束拖动时,再进行播放
|
||||||
self.play(true)
|
self.play(true)
|
||||||
// self.avPlayer?.play()
|
|
||||||
self.playerIsSeeking = false
|
self.playerIsSeeking = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user