<i id='KXNf5'><tr id='KXNf5'><dt id='KXNf5'><q id='KXNf5'><span id='KXNf5'><b id='KXNf5'><form id='KXNf5'><ins id='KXNf5'></ins><ul id='KXNf5'></ul><sub id='KXNf5'></sub></form><legend id='KXNf5'></legend><bdo id='KXNf5'><pre id='KXNf5'><center id='KXNf5'></center></pre></bdo></b><th id='KXNf5'></th></span></q></dt></tr></i><div id='KXNf5'><tfoot id='KXNf5'></tfoot><dl id='KXNf5'><fieldset id='KXNf5'></fieldset></dl></div>

<small id='KXNf5'></small><noframes id='KXNf5'>

    1. <legend id='KXNf5'><style id='KXNf5'><dir id='KXNf5'><q id='KXNf5'></q></dir></style></legend>

      • <bdo id='KXNf5'></bdo><ul id='KXNf5'></ul>
        <tfoot id='KXNf5'></tfoot>

        在 Storyboard 中实现视频视图

        Implementing video view in the Storyboard(在 Storyboard 中实现视频视图)
          <tbody id='FZOrI'></tbody>
          <bdo id='FZOrI'></bdo><ul id='FZOrI'></ul>
          1. <i id='FZOrI'><tr id='FZOrI'><dt id='FZOrI'><q id='FZOrI'><span id='FZOrI'><b id='FZOrI'><form id='FZOrI'><ins id='FZOrI'></ins><ul id='FZOrI'></ul><sub id='FZOrI'></sub></form><legend id='FZOrI'></legend><bdo id='FZOrI'><pre id='FZOrI'><center id='FZOrI'></center></pre></bdo></b><th id='FZOrI'></th></span></q></dt></tr></i><div id='FZOrI'><tfoot id='FZOrI'></tfoot><dl id='FZOrI'><fieldset id='FZOrI'></fieldset></dl></div>
            • <legend id='FZOrI'><style id='FZOrI'><dir id='FZOrI'><q id='FZOrI'></q></dir></style></legend>

                  <tfoot id='FZOrI'></tfoot>

                  <small id='FZOrI'></small><noframes id='FZOrI'>

                  本文介绍了在 Storyboard 中实现视频视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我想构建一个简单的视频应用程序,它可以查看用户添加的视频表单 youtube 链接.我没有找到VideoView",我的意思是如果图像视图用于图像,那么 UIView 用于视频.

                  I want to build simple video app thats views a video form youtube links thats users add. I didn't find "VideoView" I mean If image view is for image what is UIView for videos.

                  推荐答案

                  原库中没有执行视频查看功能的对象.但是您可以在项目中导入 MediaPlayer 框架并以编程方式添加它.

                  There is no object in the original library that performs video viewing function. But you can import the MediaPlayer framework in your project and add it programmatically.

                  这是一个 Swift 示例

                  Here is a Swift example

                  import MediaPlayer
                  
                  class Step1ViewController: UIViewController {
                  
                  var moviePlayer: MPMoviePlayerController?
                  
                  override func viewDidLoad() {
                      super.viewDidLoad()
                  
                      playVideo()
                  }
                  
                  func playVideo() {
                  
                      let videoView = UIView(frame: CGRectMake(self.view.bounds.origin.x, self.view.bounds.origin.y, self.view.bounds.width, self.view.bounds.height))
                  
                      let pathToEx1 = NSBundle.mainBundle().pathForResource("myVideoFile", ofType: "mp4")
                      let pathURL = NSURL.fileURLWithPath(pathToEx1!)
                      moviePlayer = MPMoviePlayerController(contentURL: pathURL)
                      if let player = moviePlayer {
                          player.view.frame = videoView.bounds
                          player.prepareToPlay()
                          player.scalingMode = .AspectFill
                          videoView.addSubview(player.view)
                      }
                  
                      self.view.addSubview(videoView)
                  }
                  

                  }

                  至于进一步的定制和应用通知,它有很多内置的可能性.所以看看吧.

                  As for further customisations and app notifications it has a bunch of in-build possibilities. So check it out.

                  这篇关于在 Storyboard 中实现视频视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  what#39;s property copy means in Cocoa#39;s Framework?(like UITabBar#39;s items property)(Cocoa 框架中的属性副本是什么意思?(如 UITabBar 的 items 属性))
                  Can`t copy file from bundle to documents directory in iOS(无法将文件从捆绑包复制到 iOS 中的文档目录)
                  How to copy a quot;Dictionaryquot; in Swift?(如何复制“字典在斯威夫特?)
                  Automatically copy property values from one object to another of a different type but the same protocol (Objective-C)(自动将属性值从一个对象复制到另一个类型不同但协议相同的对象 (Objective-C))
                  Copy text to clipboard with iOS(使用 iOS 将文本复制到剪贴板)
                  Swift - How to mutate a struct object when iterating over it(Swift - 迭代结构对象时如何对其进行变异)
                          <bdo id='B3Qx5'></bdo><ul id='B3Qx5'></ul>
                          <tfoot id='B3Qx5'></tfoot>

                          <i id='B3Qx5'><tr id='B3Qx5'><dt id='B3Qx5'><q id='B3Qx5'><span id='B3Qx5'><b id='B3Qx5'><form id='B3Qx5'><ins id='B3Qx5'></ins><ul id='B3Qx5'></ul><sub id='B3Qx5'></sub></form><legend id='B3Qx5'></legend><bdo id='B3Qx5'><pre id='B3Qx5'><center id='B3Qx5'></center></pre></bdo></b><th id='B3Qx5'></th></span></q></dt></tr></i><div id='B3Qx5'><tfoot id='B3Qx5'></tfoot><dl id='B3Qx5'><fieldset id='B3Qx5'></fieldset></dl></div>

                          <small id='B3Qx5'></small><noframes id='B3Qx5'>

                            <tbody id='B3Qx5'></tbody>
                        • <legend id='B3Qx5'><style id='B3Qx5'><dir id='B3Qx5'><q id='B3Qx5'></q></dir></style></legend>