
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
chimee-plugin-mobile-controlbar
Advanced tools
安装
# 依赖于 chimee, 首先需要安装 chimee
npm install chimee
# 安装控制条组件
npm install chimee-plugin-mobile-controlbar
使用
import chimee from 'chimee';
import chimeePluginMobileControlbar from 'chimee-plugin-mobile-controlbar';
// 安装插件
chimee.install(chimeePluginMobileControlbar);
const player = new chimee({
// ...
// 使用插件
plugin: [
chimeePluginMobileControlbar.name // 或者 'chimeeMobiControlbar'
]
});
也可以在页面中引用 /lib/index.browser.js
然后在页面中使用 chimeePluginMobileControlbar
一个配置 🌰 更详细的配置例子, 可以参考 /demo/index.html
plugin: [{
name: chimeePluginMobileControlbar.name,
majorColor: '',
hoverColor: '',
children: {
}
}]
组件支持的事件: 'tap', 'swipe', 'panstart', 'panmove', 'panend', 'press', 'doubletap'
* play * 类型: Object * 含义: 配置播放暂停键 icon 及事件 * 默认: {} * 可配置属性: * bitmap: true/ false 是否是位图,默认 false, 如果用户采用位图的话,则把当前的默认 svg 都清空掉, 用户通过 css background 来自己设置图片 * icon: play / pause 图标, 支持 svg 图 * animate: 当前是一个 svg path 动画,可以传 path 来实现你想要的动画 * event: 绑定 dom 事件, this 指向这个插件, 通过 this.$dom 可以拿到 dom 节点 * 注意: icon animate bitmap 都是配置图的。 bitmap 优先。其次 icon ,最后取 animate 中的值
配置 🌰
```javascirpt
{
// 可以传两个 icon 来切换播放暂停状态
icon: {
play: '',
pause: ''
},
// 当前是一个 svg path 动画,可以传 path 来实现你想要的动画
animate: {
path: {
play: {
left: ''
},
pause: {
left: ''
}
}
},
// 可以指定 event 来绑定一些事件,默认 this 是该插件,而不是 dom
event: {
tap () { console.log(''); } } } ```
currentTime
配置 🌰
{
// 可以指定 event 来绑定一些事件,默认 this 是该插件,而不是 dom
event: {
tap () {
console.log('');
}
}
}
totalTime
配置 🌰
{
// 可以指定 event 来绑定一些事件,默认 this 是该插件,而不是 dom
event: {
tap () {
console.log('');
}
}
}
progressBar
配置 🌰
{
// 可以指定 event 来绑定一些事件,默认 this 是该插件,而不是 dom
event: {
tap () {
console.log('');
}
}
}
screen
配置 🌰
{
// 可以传两个 icon 来切换播放暂停状态
icon: {
full: '',
small: ''
},
// 可以指定 event 来绑定一些事件,默认 this 是该插件,而不是 dom
event: {
tap () {
console.log('');
}
}
}
自定义组件
配置 🌰
{
tag: '',
html: ``,
// 可以指定 event 来绑定一些事件,默认 this 是该插件,而不是 dom
event: {
tap () {
console.log('');
}
}
}
在 chimee 实例上可以监听下列事件
chimeeInstance.$on('barShow', function () {
console.log('show')
})
chimeeInstance.$on('barHide', function () {
console.log('hide')
})
Q: 子组件的默认顺序是什么?
A: 在 children 没有配置的情况下会采用下面的顺序
* 注意:根据 chimee 的参数 isLive 来判断是否是直播还是点播
* 直播: play, screen
* 点播: play, currentTime, progressBar, totalTime, screen
Q: 我可以控制顺序吗?
A: 在 children 对象中,属性的书写顺序就是渲染顺序
Q: 为什么我配置了一个组件后,其他默认组件就都不存在了?
A: 假如 children 配置后, 会读 children 的属性,并渲染, 不会补充其他组件,所以,需要你把所有的组件都写.
兼容性是移动端的大坑,在各个浏览器内总有特殊的表现,遇到最多的情况是,浏览器控制了 video,强制使用他的播放器,并且有最高层级,结尾的时候还会有广告😂
我们这里总结了一些可操作方案,供大家选择,来避免踩这些移动端的坑
x5VideoOrientation: 'landscape'
直接横屏播放,不会调用 qq 浏览器的播放器欢迎各位大佬使用。有什么问题/建议,随时提。
FAQs
controlbar for chimee in mobile
We found that chimee-plugin-mobile-controlbar demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.