nidongde

 

 

1.首先导入 MediaPlayer

import MediaPlayer

2.播放事件

class ViewController:UIViewController{

var pc:MPMoviePlayerViewController!

@IBAction func playVideoBtnClicked(sender:AnyObject){

//播放资源

pc=MPMoviePlayerViewController(contentURL:NSBundle.mainBundle().URLForResource("video",

withExtension:"mp4"))

//播放

presentViewController(pc,animated:true,completion:nil)

}

}

 

 

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-10-23
  • 2021-12-29
  • 2021-11-08
  • 2021-12-02
  • 2021-11-19
  • 2022-12-23
猜你喜欢
  • 2022-02-10
  • 2021-08-28
  • 2021-11-06
  • 2021-11-21
  • 2021-12-20
  • 2021-11-17
  • 2021-11-29
相关资源
相似解决方案