Git Product home page Git Product logo

react-jplaylist's Issues

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

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!

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.