2 Star 1 Fork 1

xiungfi(前端)/vue-ckplayer

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

vue-ckplayer

介绍

基于ckplayer封装的vue-ckplayer

安装教程

   npm i vue-ckplayer -save

使用说明

	import player from 'vue-ckplayer'

props

props: {
		playStyle: {
			// 播放器样式:内联样式
			type: String,
			default: ''
		},
		sdk: {
			// 版本 sdk
			type: String,
			default: 'https://fjycjd_admin.gitee.io/cdn/ckplayer/ckplayer.min.js'
		},
		variable: {
			//调用播放器的函数名称
			type: String,
			default: 'player'
		},
		source: {
			type: String,
			default: ''
		},
		width: {
			// 播放器宽度,可形如‘100%’或者‘100px’
			type: String,
			default: '100%'
		},
		height: {
			// 播放器高度,可形如‘100%’或者‘100’
			type: String,
			default: '320'
		},
		live: {
			// 是否是直播视频
			type: Boolean,
			default: true
		},
		loop: {
			// 播放结束后是否循环播放
			type: Boolean,
			default: false
		},
		autoplay: {
			// 建议 false : 一些浏览器这样会报错
			// 播放器是否自动播放
			type: Boolean,
			default: true
		},
		poster: {
			// 设置媒体流的预览图
			type: String,
			default: ''
		},
		loaded: {
			// 播放器加载后触发的函数
			type: String,
			default: ''
		},
		volume: {
			// 设置播放器音量大小,范围(0 - 1)
			type: Number,
			default: 0.8
		},
		preview: {
			type: Array,
			default: () => {
				return [];
			}
		}
	}

API

// 加载播放器
1、loadByUrl(url)

// 播放
2、play()

// 暂停
3、pause()

// 切换播放状态
4、togglePlay()

// 设置音量
5、setVolume()

// 加载
6、load(url)

参与贡献

  1. Fork 本仓库
  2. 新建 Feat_xxx 分支
  3. 提交代码
  4. 新建 Pull Request

码云特技

  1. 使用 Readme_XXX.md 来支持不同的语言,例如 Readme_en.md, Readme_zh.md
  2. 码云官方博客 blog.gitee.com
  3. 你可以 https://gitee.com/explore 这个地址来了解码云上的优秀开源项目
  4. GVP 全称是码云最有价值开源项目,是码云综合评定出的优秀开源项目
  5. 码云官方提供的使用手册 https://gitee.com/help
  6. 码云封面人物是一档用来展示码云会员风采的栏目 https://gitee.com/gitee-stars/
MIT License Copyright (c) 2020 Admin Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

基于ckplayer封装的vue-ckplayer 展开 收起
README
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/xiungfi/vue-ckplayer.git
git@gitee.com:xiungfi/vue-ckplayer.git
xiungfi
vue-ckplayer
vue-ckplayer
master

搜索帮助