MD360Player4iOS icon indicating copy to clipboard operation
MD360Player4iOS copied to clipboard

播放器只有声音没有图像,且 Build config 时会报错

Open thecuvii opened this issue 7 years ago • 0 comments

采用的是 Swift 实现: `import UIKit import MD360Player4iOS

class PlayerViewController: UIViewController {

var video: CVCellModel!
var player: AVPlayer!
var vrLibrary: MDVRLibrary!

override func viewDidLoad() {
    super.viewDidLoad()

    dump(video)
    // Do any additional setup after loading the view.
}

override func didReceiveMemoryWarning() {
    super.didReceiveMemoryWarning()
    // Dispose of any resources that can be recreated.
}

override func viewWillAppear(_ animated: Bool) {
    super.viewWillAppear(animated)
    playVideo()
}

func playVideo(){
    let url = URL(string: video.videoUrl)
    let playerItem : AVPlayerItem! = AVPlayerItem.init(url: url!)
    player = AVPlayer(url: url!)
    player.play()
    
    var config = MDVRConfiguration.init()
    config.asVideo(playerItem)
    config.setContainer(self, view: self.view)
    
    config.displayMode(MDModeDisplay.normal)
    config.interactiveMode(MDModeInteractive.motion)
    config.pinchEnabled(true)
    
    //执行这行代码后会报错,注释掉这行代码后只能播放出声音

// self.vrLibrary = config.build() } }`

错误代码: 2017-04-05 19:07:37.239074+0800 BeimaoVR[5985:1862948] libMobileGestalt MobileGestaltSupport.m:153: pid 5985 (BeimaoVR) does not have sandbox access for frZQaeyWLUvLjeuEK43hmg and IS NOT appropriately entitled 2017-04-05 19:07:37.239179+0800 BeimaoVR[5985:1862948] libMobileGestalt MobileGestalt.c:550: no access to InverseDeviceID (see <rdar://problem/11744455>) 2017-04-05 19:07:37.278330+0800 BeimaoVR[5985:1862948] ERROR while loading from file: Error Domain=NSCocoaErrorDomain Code=258 "The file name is invalid." 2017-04-05 19:07:37.278653+0800 BeimaoVR[5985:1862948] ERROR while loading from file: Error Domain=NSCocoaErrorDomain Code=258 "The file name is invalid."

thecuvii avatar Apr 05 '17 11:04 thecuvii