在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:chimee开源软件地址:https://gitee.com/qihoo360/chimee开源软件介绍:chimeeEnglish | 中文 IntroductionChimee is a web video player created by Qiwoo Team. It's based on the web video element. It support multiple media streams, including mp4, m3u8, flv etc. In most situation, we need to support complex function based on video, such as barrage, advertising. It's hard to maintain them if you we just write it based on video. So we may need to have a frame to sort out the logic and handle the communication. So Chimee offer you a plugin system, so that you can splitt your complex function into multiple plugins. Through this reform of development, developers can decouple logic, to achieve gray-scale release and other functions. Chimee help developer to achieve video scenes easier and quicker. FeatureChimee is a web video player
What's more, it's also a component framework based on video element.
Installationnpmnpm install --save chimee cdn
UsageYou can use chimee directly. Assume you have a <body> <div id="wrapper"> </div></body> Then you can setup Chimee on it. import Chimee from 'chimee';const chimee = new Chimee('#wrapper');chimee.on('play', () => console.log('play!!'));chimee.load('http://cdn.toxicjohann.com/lostStar.mp4');chimee.play(); // play!! Sometimes we need to custom more, we can pass in an object. import Chimee from 'chimee';const chimee = new Chimee({ wrapper: '#wrapper', src: 'http://cdn.toxicjohann.com/lostStar.mp4', controls: true, autoplay: true, events: { play () { console.log('play!!'); } }});// play!! If you need to play video in flv or hls. You should add preset. import Chimee from 'chimee';import flv from 'chimee-kernel-flv';import hls from 'chimee-kernel-hls';const chimee = new Chimee({ wrapper: '#wrapper', src: 'http://cdn.toxicjohann.com/lostStar.mp4', controls: true, autoplay: true, preset: { flv, hls }});chimee.play(); If you want to know more about chimee, please click here. What's more, if you use chimes directly, it's better to add this style in your page. container { position: relative; display: block; width: 100%; height: 100%;}video { width: 100%; height: 100%; display: block; background-color: #000;}video:focus,video:active { outline: none;} Chimee will use the original skin of browser if you do not use any plugin. You may want to try our UI plugin. import ui from 'chimee-plugin-ui';import Chimee from 'chimee';Chimee.install(ui);const chimee = new Chimee({ wrapper: '#wrapper', src: 'http://cdn.toxicjohann.com/lostStar.mp4', plugin: [ui.name], controls: false, autoplay: true}); If you want to know more about Chimee's plugin, please click here. If you don't want to care too much. And just need a useful video player. You can install chimes-player, which contain base ui and logger. import ChimeePlayer from 'chimee-player';const chimee = new ChimeePlayer({ wrapper: '#wrapper', src: 'http://cdn.toxicjohann.com/lostStar.mp4', controls: false, autoplay: true}); Documentation
Explanation of Different BuildYou will find four differnet build in the lib.
Development vs. ProductionDevelopment/production modes are hard-coded for the UMD builds: the un-minified files are for development, and the minified files are for production. CommonJS and ES Module builds are intended for bundlers, therefore we don’t provide minified versions for them. You will be responsible for minifying the final bundle yourself. CommonJS and ES Module builds also preserve raw checks for WebpackUse Webpack’s DefinePlugin: var webpack = require('webpack')module.exports = { // ... plugins: [ // ... new webpack.DefinePlugin({ 'process.env': { NODE_ENV: JSON.stringify('production') } }) ]} Rollupconst replace = require('rollup-plugin-replace')rollup({ // ... plugins: [ replace({ 'process.env.NODE_ENV': JSON.stringify('production') }) ]}).then(...) Contributionclone this project npm installnpm start Then open http://127.0.0.1:10001/demo/base/index.html You can choose another page as you want ChangelogPlease read the realase notes. License |
请发表评论