Class: PanovideoViewer

PanovideoViewer

全景视频播放器. 视频协议上默认支持MP4、flv流媒体协议等协议,并支持可拓展。 功能上支持:多分辨率切换,720度视角拖拽缩放,手机重力感应,VTT协议的进度预览图等

new Hydreigon.PanovideoViewer (container, config, ak, sk, options)

Name Type Description
container HTMLElement dom容器
config Config config初始化配置
ak string | undefined ak字符码
sk string | undefined sk字符码
options HydOptions 播放器可选配置

Methods

getBuffer ()number

播放器状态:获取当前进度缓冲
Returns:
Type Description
number 值域[0,100]

getDefaultFov ()nubmer

获取默认fov值
Returns:
Type Description
nubmer fov值

getDefaultQuaternion ()object

获取相机默认四元数
Returns:
Type Description
object 四元数

getDuration ()number

获取视频总时长
Returns:
Type Description
number 毫秒值

getFov ()nubmer

获取当前fov值
Returns:
Type Description
nubmer fov值

getMute ()boolean

获取当前静音状态
Returns:
Type Description
boolean 是否静音

getPosition ()number

获取视频当前播放位置
Returns:
Type Description
number 毫秒值

getQuaternion ()object

获取相机当前四元数
Returns:
Type Description
object 四元数

getSnapshot (type, quality)string

获取截图
Name Type Description
type 图片类型,默认image/jpg
quality 图片只狼
Returns:
Type Description
string 返回base64图片

getState ()string

获取视频当前播放状态
Returns:
Type Description
string 当前播放状态

getVideoThumbnail (视频清晰度级别)

设置当前视频清晰度级别
Name Type Description
视频清晰度级别 number

getVolume ()number

播放器状态:获取当前音量
Returns:
Type Description
number 值域[0,100]

init ()Promise

生命周期:初始化函数
Returns:
Type Description
Promise , resolve鉴权成功回调函数,reject失败回调函数;

isGyroOpen ()boolean

获取当前陀螺仪状态
Returns:
Type Description
boolean 陀螺仪开启状态

pause ()

播放器控制:暂停

play ()

播放器控制:播放

resetView (fov, rotation)void

视野重设到某一位置
Name Type Description
fov number 指定fov值,默认为初始fov值
rotation object 指定的rotation值,默认为初始的rotation值
Returns:
Type Description
void

seek (num)void

指定位置播放
Name Type Description
num number 时间值
Returns:
Type Description
void

setMute (value)

设置静音状态
Name Type Description
value boolean 是否静音

setVolume (volume)boolean

设置音量
Name Type Description
volume number 范围为0-1
Returns:
Type Description
boolean 设置成功/失败

show ()

生命周期:开始渲染画面

switchGyro (enable)promise

陀螺仪开关
Name Type Description
enable boolean 开/关
Returns:
Type Description
promise

uninit ()

生命周期:反初始化函数,与init对应