编辑代码

let iv = self.view.viewWithTag(4)!
UIView.animate(withDuration: 2, animations: {
      iv.transfrom = iv.transform.rotated(by: cGFloat(360))
})
let iv = self.view.viewWithTag(4)!
UIView.animate(withDuration: 2, animations: {
     iv.frame.origin.x += 100
     if iv.frame.origin.x > self.view.frame.size.width {
         iv.frame.origin.x = 0
     }
})
let iv = self.view.viewWithTag(4) !
UIIiew.animate(withDuration: 2,animations: {
    iv.transform = CGAffineTransform(scalex: 0.8, y: 0.8)
})
let iv = self.view.viewWithTag(4) !
UIView.aniphate(withDuration: 2, animations: {
    iv.alpha = 0.1
})
// ViewController.swift
// VideoPlay_Sandbox
//
//Created by zhifeng Chen on 2020/8/3.
//copyright 2020 zhifeng chen.All rights reserved.
//
import UIKit
import AVKit

class ViewController:UIViewController {
    @IBActroller func play(_sender:Any)
    {
        let path = Bundle.main.path(forResource:"test",0fType:"mov")
        let url = URL(fileURLWithPath: path!)
        let player = AVplayer(url: url)
        let playerViewController = AVPlayerViewController()
        playerViewController.player = player
        playerviewController.view.frame = CGRect(x:20, y: 100, width: self.view.bounds.with - 40,height: 200)
           self.addChild(playerViewController)
           self.view.adddSubview(playerViewController.view)
    }
}