2017-02-07 58 views
0

我想使用AVPlayerViewController刪除音頻&字幕按鈕。我創建控制器如下:Swift AVPlayerViewController刪除音頻和字幕按鈕

// Create the view controller and player 
let moviePlayerViewController: AVPlayerViewController = AVPlayerViewController() 
let moviePlayer = AVPlayer(url: videoUrl!) 

// Initialize the AVPlayer 
moviePlayerViewController.player = moviePlayer 
moviePlayerViewController.player?.isClosedCaptionDisplayEnabled = false 

// Present movie player and play when completion 
self.present(moviePlayerViewController, animated: false, completion: { 
    moviePlayerViewController.player?.play() 
}) 

我想moviePlayerViewController.player?.isClosedCaptionDisplayEnabled = false會採取我刪除按鈕的照顧,但我錯了。任何人都可以幫我找到正確的設置來隱藏音頻&字幕按鈕?

回答

0

official doc,你不能隱藏在默認播放器佈局音頻&字幕按鈕。如果您堅持刪除該按鈕,請嘗試自定義您自己的播放器,或修改.m3u8文件以刪除多餘的字幕選項。