# Video
### Video
視頻對象
#### 屬性
##### number x
視頻的左上角橫坐標
##### number y
視頻的左上角縱坐標
##### number width
視頻的寬度
##### number height
視頻的高度
##### number src
視頻的資源地址
##### number poster
視頻的封面
##### number initialTime
視頻的初始播放位置,單位為 s 秒
##### number playbackRate
視頻的播放速率,有效值有 0.5、0.8、1.0、1.25、1.5
##### number live
視頻是否為直播
##### number objectFit
視頻的縮放模式
##### number controls
視頻是否顯示控件
##### number autoplay
視頻是否自動播放
##### number loop
視頻是否是否循環播放
##### number muted
視頻是否禁音播放
##### function onwaiting
視頻開始緩沖時觸發的回調函數
##### function onplay
視頻開始播放時觸發的回調函數
##### function onpause
視頻暫停時觸發的回調函數
##### function onended
視頻播放到末尾時觸發的回調函數
##### function ontimeupdate
每當視頻播放進度更新時觸發的回調函數
##### function onerror
視頻發生錯誤時觸發的回調函數
#### 方法
##### Video.destroy()
銷毀視頻
##### Promise Video.play()
播放視頻
##### Promise Video.pause()
暫停視頻
##### Promise Video.stop()
停止視頻
##### Promise Video.seek(number time)
視頻跳轉
##### Promise Video.requestFullScreen()
視頻全屏
##### Promise Video.exitFullScreen()
視頻退出全屏
##### Video.onWaiting(function callback)
監聽視頻緩沖事件
##### Video.offWaiting(function callback)
取消監聽視頻緩沖事件
##### Video.onPlay(function callback)
監聽視頻播放事件
##### Video.offPlay(function callback)
取消監聽視頻播放事件
##### Video.onPause(function callback)
監聽視頻暫停事件
##### Video.offPause(function callback)
取消監聽視頻暫停事件
##### Video.onEnded(function callback)
監聽視頻播放到末尾事件
##### Video.offEnded(function callback)
取消監聽視頻播放到末尾事件
##### Video.onTimeUpdate(function callback)
監聽視頻播放進度更新事件
##### Video.offTimeUpdate(function callback)
取消監聽視頻播放進度更新事件
##### Video.onError(function callback)
監聽視頻錯誤事件
##### Video.offError(function callback)
取消監聽視頻錯誤事件
> 原文: <https://developers.weixin.qq.com/minigame/dev/api/media/video/Video.html>
- 致謝
- 渲染
- 畫布
- wx.createCanvas
- Canvas
- .toTempFilePath
- .toTempFilePathSync
- .getContext
- .toDataURL
- RenderingContext
- 圖片
- wx.createImage
- Image
- 字體
- wx.getTextLineHeight
- wx.loadFont
- 幀率
- wx.setPreferredFramesPerSecond
- cancelAnimationFrame
- requestAnimationFrame
- 分包加載
- wx.loadSubpackage
- LoadSubpackageTask
- .onProgressUpdate
- 設備
- 設備方向
- wx.startDeviceMotionListening
- wx.stopDeviceMotionListening
- wx.onDeviceMotionChange
- 加速計
- wx.startAccelerometer
- wx.stopAccelerometer
- wx.onAccelerometerChange
- 剪貼板
- wx.getClipboardData
- wx.setClipboardData
- 羅盤
- wx.startCompass
- wx.stopCompass
- wx.onCompassChange
- 陀螺儀
- wx.startGyroscope
- wx.stopGyroscope
- wx.onGyroscopeChange
- 電量
- wx.getBatteryInfo
- wx.getBatteryInfoSync
- 網絡
- wx.getNetworkType
- wx.onNetworkStatusChange
- 振動
- wx.vibrateShort
- wx.vibrateLong
- 性能
- wx.onMemoryWarning
- 屏幕
- wx.getScreenBrightness
- wx.setKeepScreenOn
- wx.setScreenBrightness
- 轉屏
- wx.onDeviceOrientationChange
- wx.offDeviceOrientationChange
- 系統
- 系統信息
- wx.getSystemInfo
- wx.getSystemInfoSync
- 系統事件
- wx.onAudioInterruptionBegin
- wx.offAudioInterruptionBegin
- wx.onAudioInterruptionEnd
- wx.offAudioInterruptionEnd
- wx.onError
- wx.offError
- 生命周期
- wx.exitMiniProgram
- wx.getLaunchOptionsSync
- wx.onHide
- wx.offHide
- wx.onShow
- wx.offShow
- 觸摸事件
- wx.onTouchStart
- wx.offTouchStart
- wx.onTouchMove
- wx.offTouchMove
- wx.onTouchEnd
- wx.offTouchEnd
- wx.onTouchCancel
- wx.offTouchCancel
- Touch
- 位置
- wx.getLocation
- 媒體
- 圖片
- wx.chooseImage
- wx.previewImage
- wx.saveImageToPhotosAlbum
- 音頻
- wx.createInnerAudioContext
- wx.getAvailableAudioSources
- wx.setInnerAudioOption
- InnerAudioContext
- .pause
- .stop
- .seek
- .destroy
- .offCanplay
- .onPlay
- .offPlay
- .onPause
- .offPause
- .onStop
- .offStop
- .onEnded
- .offEnded
- .onTimeUpdate
- .offTimeUpdate
- .onError
- .onCanplay
- .offError
- .onWaiting
- .offWaiting
- .onSeeking
- .offSeeking
- .onSeeked
- .offSeeked
- .play
- 錄音
- wx.getRecorderManager
- RecorderManager
- .start
- .pause
- .resume
- .stop
- .onStart
- .onResume
- .onPause
- .onStop
- .onFrameRecorded
- .onError
- .onInterruptionBegin
- .onInterruptionEnd
- 視頻
- wx.createVideo
- Video
- .onWaiting
- .offWaiting
- .onPlay
- .offPlay
- .onPause
- .offPause
- .onEnded
- .offEnded
- .onTimeUpdate
- .offTimeUpdate
- .onError
- .offError
- .destroy
- .play
- .pause
- .stop
- .seek
- .requestFullScreen
- .exitFullScreen
- 文件
- wx.getFileSystemManager
- FileSystemManager
- .access
- .accessSync
- .appendFile
- .appendFileSync
- .saveFile
- .saveFileSync
- .getSavedFileList
- .removeSavedFile
- .copyFile
- .copyFileSync
- .getFileInfo
- .mkdir
- .mkdirSync
- .readFile
- .readFileSync
- .readdir
- .readdirSync
- .rename
- .renameSync
- .rmdir
- .rmdirSync
- .stat
- .statSync
- .unlink
- .unlinkSync
- .unzip
- .writeFile
- .writeFileSync
- Stats
- .isDirectory
- .isFile
- 網絡
- 下載
- wx.downloadFile
- DownloadTask
- .onProgressUpdate
- .abort
- 發起請求
- wx.request
- RequestTask
- .abort
- WebSocket
- wx.connectSocket
- wx.closeSocket
- wx.sendSocketMessage
- wx.onSocketOpen
- wx.onSocketClose
- wx.onSocketMessage
- wx.onSocketError
- SocketTask
- .close
- .onOpen
- .onClose
- .onError
- .onMessage
- .send
- 上傳
- wx.uploadFile
- UploadTask
- .onProgressUpdate
- .abort
- 開放接口
- 游戲圈
- wx.createGameClubButton
- GameClubButton
- .onTap
- .offTap
- .show
- .hide
- .destroy
- 開放數據
- wx.getFriendCloudStorage
- wx.getGroupCloudStorage
- wx.getUserCloudStorage
- wx.removeUserCloudStorage
- wx.setUserCloudStorage
- wx.getSharedCanvas
- UserGameData
- KVData
- removeUserStorage
- setUserStorage
- 授權
- wx.authorize
- 防沉迷
- wx.checkIsUserAdvisedToRest
- 用戶信息
- wx.getUserInfo
- wx.createUserInfoButton
- UserInfo
- UserInfoButton
- .show
- .hide
- .destroy
- .onTap
- .offTap
- 微信運動
- wx.getWeRunData
- 設置
- wx.getSetting
- wx.openSetting
- wx.createOpenSettingButton
- OpenSettingButton
- .onTap
- .offTap
- .show
- .hide
- .destroy
- AuthSetting
- 登錄
- wx.login
- wx.checkSession
- checkSessionKey
- code2Session
- 意見反饋
- wx.createFeedbackButton
- FeedbackButton
- .onTap
- .offTap
- .show
- .hide
- .destroy
- 小程序跳轉
- wx.navigateToMiniProgram
- 客服消息
- wx.openCustomerServiceConversation
- 開放數據域
- wx.getOpenDataContext
- wx.onMessage
- OpenDataContext
- .postMessage
- 接口調用憑證
- getAccessToken
- 內容安全
- imgSecCheck
- msgSecCheck
- 二維碼
- createWXAQRCode
- getWXACode
- getWXACodeUnlimit
- 調試
- wx.setEnableDebug
- console
- .groupEnd
- .debug
- .log
- .info
- .warn
- .error
- .group
- 數據緩存
- wx.getStorage
- wx.getStorageSync
- wx.setStorage
- wx.setStorageSync
- wx.removeStorage
- wx.removeStorageSync
- wx.clearStorage
- wx.clearStorageSync
- wx.getStorageInfo
- wx.getStorageInfoSync
- 更新
- wx.getUpdateManager
- UpdateManager
- .onCheckForUpdate
- .onUpdateReady
- .onUpdateFailed
- .applyUpdate
- Worker
- wx.createWorker
- Worker
- .postMessage
- .onMessage
- .terminate
- 轉發
- wx.getShareInfo
- wx.hideShareMenu
- wx.showShareMenu
- wx.updateShareMenu
- wx.shareAppMessage
- wx.onShareAppMessage
- wx.offShareAppMessage
- 廣告
- wx.createRewardedVideoAd
- wx.createBannerAd
- RewardedVideoAd
- .load
- .show
- .onLoad
- .offLoad
- .onError
- .offError
- .onClose
- .offClose
- BannerAd
- .show
- .hide
- .destroy
- .onResize
- .offResize
- .onLoad
- .offLoad
- .onError
- .offError
- 界面
- 交互
- wx.showToast
- wx.showModal
- wx.hideToast
- wx.showLoading
- wx.hideLoading
- wx.showActionSheet
- 菜單
- wx.getMenuButtonBoundingClientRect
- wx.setMenuStyle
- 鍵盤
- wx.showKeyboard
- wx.hideKeyboard
- wx.updateKeyboard
- wx.onKeyboardInput
- wx.offKeyboardInput
- wx.onKeyboardConfirm
- wx.offKeyboardConfirm
- wx.onKeyboardComplete
- wx.offKeyboardComplete
- 狀態欄
- wx.setStatusBarStyle
- 窗口
- wx.onWindowResize
- wx.offWindowResize
- 性能
- wx.getPerformance
- wx.triggerGC
- Performance
- .now
- 虛擬支付
- wx.requestMidasPayment
- midasCancelPay
- midasGetBalance
- midasPay
- midasPresent
- 定時器
- setTimeout
- clearTimeout
- setInterval
- clearInterval