aliplayer-react
React component wrapper for aliplayer.
Last updated 25 days ago by wangsijie .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install aliplayer-react 
SYNC missed versions from official npm registry.

ALIPLAYER-REACT

React component wrapper for aliplayer.

Current version: 2.8.2

Installation

npm i aliplayer-react

Usage

Edit aliplayer-react

import React, { Component } from 'react';
import ReactDOM from 'react-dom';
import Player from 'aliplayer-react';

const config = {
    source: "//player.alicdn.com/video/aliyunmedia.mp4",
    width: "100%",
    height: "500px",
    autoplay: true,
    isLive: false,
    rePlay: false,
    playsinline: true,
    preload: true,
    controlBarVisibility: "hover",
    useH5Prism: true,
    components: [
        {
            name: "RateComponent",
            type: Player.components.RateComponent,
        }
    ]
};

class App extends Component {
    state = {
        instance: null,  // player instance, e.g: player.stop();
    }
    render() {
        return <div>
            <Player
                config={config}
                onGetInstance={instance => this.setState({ instance })}
                // Optional: custom cdn url
                // sourceUrl={'https://g.alicdn.com/de/prismplayer/2.8.2/aliplayer-min.js'}
            />
        </div>
    }
}

ReactDOM.render(<App />, document.getElementById('root'));

Current Tags

  • 0.5.0                                ...           latest (25 days ago)

12 Versions

  • 0.5.0                                ...           25 days ago
  • 0.4.3                                ...           7 months ago
  • 0.4.2                                ...           9 months ago
  • 0.4.1                                ...           9 months ago
  • 0.4.0                                ...           9 months ago
  • 0.3.1                                ...           10 months ago
  • 0.3.0                                ...           10 months ago
  • 0.2.2                                ...           10 months ago
  • 0.2.1                                ...           10 months ago
  • 0.2.0                                ...           10 months ago
  • 0.1.1                                ...           10 months ago
  • 0.1.0                                ...           10 months ago
Maintainers (1)
Downloads
Today 0
This Week 30
This Month 88
Last Day 10
Last Week 42
Last Month 258
Dependencies (0)
None
Dev Dependencies (9)

Copyright 2014 - 2017 © taobao.org |