jplayer / react-jplaylist Goto Github PK
View Code? Open in Web Editor NEWHtml5 audio and video playlist library for React that implements react-jPlayer
License: MIT License
Html5 audio and video playlist library for React that implements react-jPlayer
License: MIT License
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
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.
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!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.