Git Product home page Git Product logo

react-jplaylist's Introduction

jPlayer : HTML5 Audio & Video for jQuery

Gitter

Support for Zepto 1.0+ compiled with the data module.

What is jPlayer?

jPlayer is a jQuery/Zepto plugin that allows you to:

  • play and control media files in your webpage.
  • create a consistent interface and experience across all browsers.
  • create and style a media player using just HTML and CSS.
  • add audio and video to your jQuery/Zepto projects.
  • support more devices using HTML5.
  • support older browsers using a Flash fall-back/forward.
  • control media on your website using a JavaScript API.

jPlayer supports:

  • HTML5: mp3, m4a (AAC), m4v (H.264), ogv*, oga*, wav*, webm*
  • Flash: mp3, m4a (AAC), m4v (H.264), rtmp, flv.

(*) Optional counterpart formats to increase HTML5 cross-browser support.

Bower Install

  • simple install using bower install jplayer
  • see http://bower.io/ for more information.

Composer install

Install jPlayer via composer by adding the following lines to your composer.json in your project:

// ...
"require": {
    // ...
    "happyworm/jPlayer": "2.*"
    // ...
}
// ...
"config": {
    "component-dir": "your/desired/asset/path"
},
// ...

Then execute the following:

php composer.phar update

Composer will now download all components and install the needed files into your/desired/asset/path, ready to use.

License

jPlayer is licensed under the MIT license.

More information:

Author:

Mark J Panaghiston @thepag happyworm.com

Alternative Versions

react-jplaylist's People

Contributors

martindawson avatar testtttt23 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-jplaylist's Issues

Cannot read property 'focused' of undefined

jPlaylist example error:
Uncaught TypeError: Cannot read property 'focused' of undefined in jPlaylistContainer.js:40

And i couldn't understand why playlist not required id. It's based on play, i know.

Setting jPlaylist.playlist from parent component

Hi guys,

Thanks for the amazing library!
I'm new in React/Redux, so I have a question about initializing playlists in runtime. How can I to do this?

JPlayer component:

import React from 'react';
import { Gui, SeekBar, BufferBar,
  Poster, Audio, Title, Mute, Play, PlayBar,
  VolumeBar, Duration, CurrentTime, Download, BrowserUnsupported,
} from 'react-jplayer';
import JPlaylist, { connect, Playlist, Shuffle, Next, Previous, Repeat,
  MediaLink, Title as PlaylistTitle } from 'react-jplaylist';

const options = {
  id: 'JPlayer',
  verticalVolume: true,
};

const jPlaylistOptions = {
  hidePlaylist: false,
  playlist: INIT_FROM_PARENT,
};

const JPlayer = () => {
  return (<JPlaylist className='jp-sleek'>
    code here...
  </JPlaylist>);
};

export default connect(JPlayer, options, jPlaylistOptions);

JPlaylist component:

import React, { Component } from 'react';
import { Provider } from 'react-redux';
import { createStore, combineReducers } from 'redux';
import { initialState as jPlayerInitialState, reducer as jPlayers } from 'react-jplayer';
import { initialState as jPlaylistInitialState, reducer as jPlaylists } from 'react-jplaylist';
import JPlayer from './JPlayer';

const store = createStore(combineReducers({
  jPlayers,
  jPlaylists,
}), {
  jPlayers: jPlayerInitialState(JPlayer),
  jPlaylists: jPlaylistInitialState(JPlayer),
}, window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__());

class JPlaylist extends Component {
  constructor(props) {
    super(props);
  }

  render() {
    const playlist = this.props.tracks.map(track => {
      return {
        title: track.title,
        artist: track.performer,
        sources: {
          mp3: track.url,
        },
      }
    });
    return (<div className='audio-list'>
      <Provider store={store}>
        <JPlayer playlist={playlist}/>
      </Provider>
    </div>
    );
  }
}

export default JPlaylist;

I need to pass this.props.tracks from parent component (any page in website) to INIT_FROM_PARENT in JPlayer

Thanks for your help!

player list not added new media

when i added new media list:
actions.add(id, media, true)
it is worked.

BUT
actions.add(id, media, false):
not worked!!!

TypeError: playlist[current] is undefined

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.