Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I think you may want to update your copy #1

Open
wants to merge 49 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
3794aa2
Ensure the instance of player exist before calling any method (#4)
fabio-paiva-sp Aug 7, 2017
b2e8d87
Added support for video as file address (#5)
fahadAziz44 Aug 10, 2017
09d06d0
v1.4.0
xDae Aug 10, 2017
1d179ef
📘 updated docs
xDae Aug 10, 2017
b5cfca0
Updates react to 15.6.0 and adds `prop-types` dependency (#7)
cfey Oct 26, 2017
3ac487c
Fixes #8 where it enables iconUrl option. (#9)
samahndev Oct 28, 2017
afb5830
bump package version
xDae Oct 28, 2017
48c7596
updated to latest plyr 2.0.18 (#10)
kylesziv Nov 16, 2017
7627ddb
Improvements (#12)
mhluska Dec 6, 2017
2fc279e
update storybook and deps
xDae Dec 6, 2017
7b2093d
update docs & missing depencency
xDae Dec 6, 2017
3a2e5eb
update docs
xDae Dec 6, 2017
f30fca0
upload new docs
xDae Dec 6, 2017
649c0bc
1.8.0
xDae Dec 6, 2017
52d2d28
fix version number
xDae Dec 6, 2017
cdd0c91
📖 Added props to readme.md
xDae Jan 7, 2018
7838f84
support audio (#16)
benwaffle Feb 21, 2018
cbd0f4d
1.8.0
xDae Feb 21, 2018
605fa16
1.8.1
xDae Feb 21, 2018
89366c7
update storybook
xDae Feb 21, 2018
c1ee356
Bump plyr dependency to 3.2.1 (#23)
flacerdk Apr 30, 2018
ebb2c6f
update plyr to latest version & fixes
xDae May 6, 2018
4d72160
bump version
xDae May 6, 2018
9bd81a9
added more events & fixes
xDae May 7, 2018
5bcd60d
updated storybook
xDae May 7, 2018
9613573
added more event types
xDae May 7, 2018
241128c
added demo page
xDae May 8, 2018
ca6f3b9
update demo & screenshot
xDae May 8, 2018
6dcbd81
update video & update docs
xDae May 29, 2018
b9cbbed
updated storybook
xDae May 29, 2018
1210a3b
fixed package version
xDae May 29, 2018
db27bc7
2.0.0
xDae May 29, 2018
4a41023
2.0.1
xDae May 29, 2018
a56a0bc
bumped version
xDae May 29, 2018
34e388d
SSR fix for referenced navigator object in defaultProps.js (#30)
brandoneggar Jun 3, 2018
c41b717
Fixed CDN CSS URL (#32)
frogg Jun 28, 2018
39c1850
Return the player object onReady (#33)
Coriou Jun 29, 2018
28cf53b
added contributors to package.json
xDae Jul 1, 2018
9a26e13
update deps
xDae Jul 1, 2018
ea36ba0
update docs
xDae Jul 1, 2018
0a26649
2.1.0
xDae Jul 1, 2018
123a7c2
added prepublish script & update package versions
xDae Jul 5, 2018
d9a74d1
bump package version
xDae Jul 14, 2018
cf84001
feature/set current time (#38)
brandoneggar Jul 16, 2018
9b07f9d
Test against modern node versions, ci cache yarn (#43)
amilajack Aug 22, 2018
e735a4e
Allow captions to be added to videos (#47)
vikr01 Aug 28, 2018
9b0eafc
Bump Plyr version + add props table to Readme (#61)
Coriou Feb 12, 2019
78971ea
Use ref instead of className to pinpoint the dom element (#55)
rolfvandekrol Feb 12, 2019
ff85f2c
Update index.js
robertkraig Feb 21, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions .storybook/addons.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// To get our default addons (actions and links)
import '@kadira/storybook/addons';
// To add the knobs addon
import '@kadira/storybook-addon-knobs/register'
import '@kadira/storybook-addon-options/register';
import '@storybook/addon-options/register';
import '@storybook/addon-actions/register';
20 changes: 16 additions & 4 deletions .storybook/config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
import { configure, setAddon } from '@kadira/storybook';
import infoAddon from '@kadira/react-storybook-addon-info';
import { setOptions } from '@kadira/storybook-addon-options';
import { configure, setAddon } from '@storybook/react';
import { setDefaults } from '@storybook/addon-info';
import { setOptions } from '@storybook/addon-options';

setAddon(infoAddon);
// setDefaults({
// header: false, // Toggles display of header with component name and description
// inline: true, // Displays info inline vs click button to view
// source: true, // Displays the source of story Component
// propTables: [/* Components used in story */], // displays Prop Tables with this components
// propTablesExclude: [], // Exclude Components from being shown in Prop Tables section
// styles: {}, // Overrides styles of addon
// marksyConf: {}, // Overrides components used to display markdown. Warning! This option's name will be likely deprecated in favor to "components" with the same API in 3.3 release. Follow this PR #1501 for details
// maxPropsIntoLine: 1, // Max props to display per line in source code
// maxPropObjectKeys: 10, // Displays the first 10 characters of the prop name
// maxPropArrayLength: 10, // Displays the first 10 items in the default prop array
// maxPropStringLength: 100, // Displays the first 100 characters in the default prop string
// });

setOptions({
name: 'React Plyr',
Expand Down
1 change: 0 additions & 1 deletion .storybook/head.html

This file was deleted.

1 change: 1 addition & 0 deletions .storybook/preview-head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<link rel="stylesheet" href="https://cdn.plyr.io/3.4.8/plyr.css">
145 changes: 126 additions & 19 deletions .storybook/stories/index.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,142 @@
import React, { Component } from 'react';
import { storiesOf } from '@kadira/storybook';
import { withKnobs, text, number, select } from '@kadira/storybook-addon-knobs';
import withWrapper from './withWrapper'
import React, { Component, Fragment } from 'react';
import { storiesOf } from '@storybook/react';
// import { withKnobs, text, number, select } from '@storybook/addon-knobs';
import { action } from '@storybook/addon-actions';
import { withInfo } from '@storybook/addon-info';

import './withWrapper';
import './updateVideoSource';

import Plyr from '../../src';

const stories = storiesOf('React Plyr', module);
stories.addDecorator(withKnobs);

stories.addWithInfo('Default Youtube video', () => (
stories.add('Simple Youtube video', withInfo()(() =>
<Plyr videoId="CDFN1VatiJA" debug />
))

stories.add('Video with all Controls', withInfo()(() =>
<Plyr
videoId="CDFN1VatiJA"
videoId="bTqVqk7FSmY"
controls={[
'play-large', // The large play button in the center
'restart', // Restart playback
'rewind', // Rewind by the seek time (default 10 seconds)
'play', // Play/pause playback
'fast-forward', // Fast forward by the seek time (default 10 seconds)
'progress', // The progress bar and scrubber for playback and buffering
'current-time', // The current time of playback
'duration', // The full duration of the media
'mute', // Toggle mute
'volume', // Volume control
'captions', // Toggle captions
'settings', // Settings menu
'pip', // Picture-in-picture (currently Safari only)
'airplay', // Airplay (currently Safari only)
'fullscreen', // Toggle fullscreen
]}
/>
))
stories.addWithInfo('Default Vimeo video', () => (

stories.add('Simple Vimeo video', withInfo()(() =>
<Plyr
type="vimeo"
videoId="https://vimeo.com/189789787"
/>
))
stories.addWithInfo('Player with autoplay and callbacks', () => (

stories.add('Default video with file address', withInfo()(() =>
<Plyr
type="video"
url="https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-720p.mp4"
title="View From A Blue Moon"
poster="https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-HD.jpg"
/>
))

stories.add('Default video with multiple file addresses', withInfo()(() =>
<Plyr
videoId="MM0XgD89Tr8"
type="video"
title="View From A Blue Moon"
poster="https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-HD.jpg"
sources={[
{
src: 'https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-576p.mp4',
type: 'video/mp4',
size: 576,
},
{
src: 'https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-720p.mp4',
type: 'video/mp4',
size: 720,
},
{
src: 'https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-1080p.mp4',
type: 'video/mp4',
size: 1080,
},
{
src: 'https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-1440p.mp4',
type: 'video/mp4',
size: 1440,
},
]}
/>
))

stories.add('Player with autoplay and callbacks', withInfo()(() =>
<Plyr
videoId="M6_a2wBK-yc"
volume={0.4}
autoplay
onReady={console.log('Is Ready!')}
onPlay={() => console.log('Play!')}
onPause={() => console.log('Paused!')}
onEnd={() => console.log('Video has finished!')}
onEnterFullscreen={() => console.log('Fullscreen is enabled')}
onExitFullscreen={() => console.log('Fullscreen is disabled')}
onVolumeChange={volume => console.log('volume changed', volume)}
onSeeked={time => console.log('seeked!', time)}
onReady={action('Video is ready!')}
onPlay={action('Play!')}
onPause={action('Video is paused')}
onEnd={action('Video has finished!')}
onEnterFullscreen={action('Fullscreen is enabled')}
onExitFullscreen={action('Fullscreen is disabled')}
onVolumeChange={action('Volume changed')}
onSeeked={action('Seeked')}
/>
))

stories.add('Audio player with url', withInfo()(() =>
<Plyr
type="audio"
url="https://archive.org/download/testmp3testfile/mpthreetest.mp3"
/>
));
))

stories.add('Audio player with sources', withInfo()(() =>
<Plyr
type="audio"
sources={[
{
src: "https://archive.org/download/testmp3testfile/mpthreetest.ogg",
type: "audio/ogg"
},
{
src: "https://archive.org/download/testmp3testfile/mpthreetest.mp3",
type: "audio/mpeg"
}
]}
/>
))

stories.add('Multiple players on same page', withInfo()(() => (
<Fragment>
{[
"https://www.sample-videos.com/video/mp4/720/big_buck_bunny_720p_1mb.mp4",
"https://www.sample-videos.com/video/mp4/720/big_buck_bunny_720p_1mb.mp4",
"https://www.sample-videos.com/video/mp4/720/big_buck_bunny_720p_1mb.mp4"
].map((video, index) => (
<div key={index} style={{ width: 540 }}>
<Plyr
url={video}
type="video"
className={`react-plyr-${index}`}
/>
</div>
))}
</Fragment>
)))
44 changes: 44 additions & 0 deletions .storybook/stories/updateVideoSource.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import React, { Component, Fragment } from 'react';
import { storiesOf } from '@storybook/react';
import { action } from '@storybook/addon-actions';
import { withInfo } from '@storybook/addon-info';

import Plyr from '../../src';

const stories = storiesOf('React Plyr', module);

const videos = {
youtube: { id: 'yGh0bjzj4IQ', provider: 'youtube' },
vimeo: { id: '76979871', provider: 'vimeo' },
};

class Wrapper extends Component {
constructor(props) {
super(props);

this.state = {
video: 'youtube'
}
}

render() {
return (
<Fragment>
<Plyr
videoId={videos[this.state.video].id}
provider={videos[this.state.video].provider}
ref={plyr => this.plyr = plyr}
/>

<hr />

<button onClick={() => this.setState({ video: 'youtube' })}>Set Youtube video source</button>
<button onClick={() => this.setState({ video: 'vimeo' })}>Set Vimeo video source</button>
</Fragment>
);
}
}

export default stories.add('Updating video on the fly', withInfo()(() =>
<Wrapper />
));
Loading