Giter Site home page Giter Site logo

larkplayer-ui's Introduction

larkplayer-ui

larkplayer 提供自定义样式

  • 组件化
  • 支持 jsx 语法
  • 自适应 pc 与移动端

注意:此插件会修改 controls 方法:

  • 修改前:player.controls() 返回或控制 video 标签的 controls 属性
  • 修改后:player.controls() 返回或控制当前自定义样式是否展示。video 标签上的 controls 属性会被移除

*注意:此插件会新增 controlsshow controlshide 事件,用以同步控制条显隐状态

截图

PC

MOBILE

下载

NPM

npm install larkplayer-ui

CDN

<script src="https://unpkg.com/larkplayer-ui@latest/dist/larkplayer-ui.js"></script>

使用

script

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>larkplayer custom style</title>
    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,initial-scale=1.0,user-scalable=no">
</head>
<body>
    <video id="video-el" src="https://baikebcs.bdimg.com/baike-other/big-buck-bunny.mp4"></video>

    <script src="https://unpkg.com/larkplayer@latest/dist/larkplayer.js"></script>
    <script src="https://unpkg.com/larkplayer-ui@latest/dist/larkplayer-ui.js"></script>

    <script type="text/javascript">
        var width = Math.min(document.body.clientWidth, 640);
        var player = larkplayer('video-el', {
            width: width,
            height: width * 9 / 16
        });
    </script>
</body>
</html>

模块化

import larkplayer from 'larkplayer';
import 'larkplayer-ui';

const player = larkplayer('video-el-id');

License

larkplayer-ui is MIT licensed

larkplayer-ui's People

Contributors

dblate avatar kevinflyer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

larkplayer-ui's Issues

关于移动端全屏按钮不显示的问题

发现是由全局box-sizing: border-box;引起的,把.lark-fullscreen-button中的padding设置为0,使用margin: 0 14px;替换就好了,不知道作者有空调整一下吗?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.