Docs updates

This commit is contained in:
Sam Potts 2020-02-09 21:52:34 +00:00
parent 95431639a0
commit 93e3f8946a
3 changed files with 57 additions and 16 deletions

View File

@ -2,9 +2,10 @@
- Typescript typings (thanks @ondratra) - Typescript typings (thanks @ondratra)
- `togglePlay` now also returns a `Promise` (thanks @azizhk) - `togglePlay` now also returns a `Promise` (thanks @azizhk)
- Documentation improvements (thanks @MaxGiting, @0xflotus and @thatrobotdev) - Documentation improvements and typo fixes (thanks @ffpetrovic, @skerbis, @ayunami2000, @pjbaert, @MaxGiting, @0xflotus and @thatrobotdev)
- Accessibility tweak for the play button (thanks @lunika) - Accessibility tweak for the play button (thanks @lunika)
- Fix for ads configuration (thanks @SoftCreatR) - Fix for ads configuration (thanks @SoftCreatR)
- Fix handling listener return value (thanks @taion)
- Added localisation key for PIP (picture-in-picture) (thanks @lmislm) - Added localisation key for PIP (picture-in-picture) (thanks @lmislm)
- Preserve viewBox attribute in SVG sprite symbols (thanks @bseib) - Preserve viewBox attribute in SVG sprite symbols (thanks @bseib)
- Fix being unable to unmute autoplayed video on iOS (thanks @sumanbh) - Fix being unable to unmute autoplayed video on iOS (thanks @sumanbh)
@ -17,6 +18,11 @@
- Fix for multiple poster image downloads (use the native poster only for HTML5 videos) - Fix for multiple poster image downloads (use the native poster only for HTML5 videos)
- Various presentational fixes - Various presentational fixes
- Removed logic to hide/show volume controls based on audio track detection due to it's problematic nature. If you want to hide volume control, use the `controls` option to do so. - Removed logic to hide/show volume controls based on audio track detection due to it's problematic nature. If you want to hide volume control, use the `controls` option to do so.
- Fix preview thumbnail scrubbing not working on mobile touch devices (thanks @ydylla)
- Add download attribute to download button (thanks @Code1110)
- Trap keyboard focus only when fullscreen (thanks @k-jensen)
- Improvements to speed options - you can now specify all options in the UI (YouTube and Vimeo only accept 0.5-2) (thanks @ydylla)
- Improve/fix quality change state restoring (thanks @ydylla)
_Note:_ This update contains CSS changes. _Note:_ This update contains CSS changes.

View File

@ -1,6 +1,6 @@
{ {
"name": "plyr", "name": "plyr",
"version": "3.5.7-beta.0", "version": "3.5.7",
"description": "A simple, accessible and customizable HTML5, YouTube and Vimeo media player", "description": "A simple, accessible and customizable HTML5, YouTube and Vimeo media player",
"homepage": "https://plyr.io", "homepage": "https://plyr.io",
"author": "Sam Potts <sam@potts.es>", "author": "Sam Potts <sam@potts.es>",

63
src/js/plyr.d.ts vendored
View File

@ -6,7 +6,6 @@
export = Plyr; export = Plyr;
export as namespace Plyr; export as namespace Plyr;
declare class Plyr { declare class Plyr {
/** /**
* Setup a new instance * Setup a new instance
@ -201,17 +200,26 @@ declare class Plyr {
/** /**
* Add an event listener for the specified event. * Add an event listener for the specified event.
*/ */
on(event: Plyr.StandardEvent | Plyr.Html5Event | Plyr.YoutubeEvent, callback: (this: this, event: Plyr.PlyrEvent) => void): void; on(
event: Plyr.StandardEvent | Plyr.Html5Event | Plyr.YoutubeEvent,
callback: (this: this, event: Plyr.PlyrEvent) => void,
): void;
/** /**
* Add an event listener for the specified event once. * Add an event listener for the specified event once.
*/ */
once(event: Plyr.StandardEvent | Plyr.Html5Event | Plyr.YoutubeEvent, callback: (this: this, event: Plyr.PlyrEvent) => void): void; once(
event: Plyr.StandardEvent | Plyr.Html5Event | Plyr.YoutubeEvent,
callback: (this: this, event: Plyr.PlyrEvent) => void,
): void;
/** /**
* Remove an event listener for the specified event. * Remove an event listener for the specified event.
*/ */
off(event: Plyr.StandardEvent | Plyr.Html5Event | Plyr.YoutubeEvent, callback: (this: this, event: Plyr.PlyrEvent) => void): void; off(
event: Plyr.StandardEvent | Plyr.Html5Event | Plyr.YoutubeEvent,
callback: (this: this, event: Plyr.PlyrEvent) => void,
): void;
/** /**
* Check support for a mime type. * Check support for a mime type.
@ -225,12 +233,39 @@ declare class Plyr {
} }
declare namespace Plyr { declare namespace Plyr {
type MediaType = "audio" | "video"; type MediaType = 'audio' | 'video';
type Provider = "html5" | "youtube" | "vimeo"; type Provider = 'html5' | 'youtube' | 'vimeo';
type StandardEvent = "progress" | "playing" | "play" | "pause" | "timeupdate" | "volumechange" | "seeking" | "seeked" | "ratechange" | "ended" | "enterfullscreen" | "exitfullscreen" type StandardEvent =
| "captionsenabled" | "captionsdisabled" | "languagechange" | "controlshidden" | "controlsshown" | "ready"; | 'progress'
type Html5Event = "loadstart" | "loadeddata" | "loadedmetadata" | "canplay" | "canplaythrough" | "stalled" | "waiting" | "emptied" | "cuechange" | "error"; | 'playing'
type YoutubeEvent = "statechange" | "qualitychange" | "qualityrequested"; | 'play'
| 'pause'
| 'timeupdate'
| 'volumechange'
| 'seeking'
| 'seeked'
| 'ratechange'
| 'ended'
| 'enterfullscreen'
| 'exitfullscreen'
| 'captionsenabled'
| 'captionsdisabled'
| 'languagechange'
| 'controlshidden'
| 'controlsshown'
| 'ready';
type Html5Event =
| 'loadstart'
| 'loadeddata'
| 'loadedmetadata'
| 'canplay'
| 'canplaythrough'
| 'stalled'
| 'waiting'
| 'emptied'
| 'cuechange'
| 'error';
type YoutubeEvent = 'statechange' | 'qualitychange' | 'qualityrequested';
interface FullscreenControl { interface FullscreenControl {
/** /**
@ -393,7 +428,7 @@ declare namespace Plyr {
* Allows binding of event listeners to the controls before the default handlers. See the defaults.js for available listeners. * Allows binding of event listeners to the controls before the default handlers. See the defaults.js for available listeners.
* If your handler prevents default on the event (event.preventDefault()), the default handler will not fire. * If your handler prevents default on the event (event.preventDefault()), the default handler will not fire.
*/ */
listeners?: {[key: string]: (error: PlyrEvent) => void}; listeners?: { [key: string]: (error: PlyrEvent) => void };
/** /**
* active: Toggles if captions should be active by default. language: Sets the default language to load (if available). 'auto' uses the browser language. * active: Toggles if captions should be active by default. language: Sets the default language to load (if available). 'auto' uses the browser language.
@ -418,7 +453,7 @@ declare namespace Plyr {
storage?: StorageOptions; storage?: StorageOptions;
/** /**
* selected: The default speed for playback. options: Options to display in the menu. Most browsers will refuse to play slower than 0.5. * selected: The default speed for playback. options: The speed options to display in the UI. YouTube and Vimeo will ignore any options outside of the 0.5-2 range, so options outside of this range will be hidden automatically.
*/ */
speed?: SpeedOptions; speed?: SpeedOptions;
@ -527,7 +562,7 @@ declare namespace Plyr {
size?: number; size?: number;
} }
type TrackKind = "subtitles" | "captions" | "descriptions" | "chapters" | "metadata"; type TrackKind = 'subtitles' | 'captions' | 'descriptions' | 'chapters' | 'metadata';
interface Track { interface Track {
/** /**
* Indicates how the text track is meant to be used * Indicates how the text track is meant to be used
@ -550,7 +585,7 @@ declare namespace Plyr {
} }
interface PlyrEvent extends CustomEvent { interface PlyrEvent extends CustomEvent {
readonly detail: { readonly plyr: Plyr; }; readonly detail: { readonly plyr: Plyr };
} }
interface Support { interface Support {