80s toys - Atari. I still have
HomeBlogAbout Me

Plyr Npm



Vw digifant manual. This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including plyr with all npm packages installed. Dynamic NPM dependency loading in Liferay. This is an example of a npm dependency module which in Liferay we call a provider. It is useful because you can dynamically add npm dependencies to your Liferay as OSGI modules and then call them asynchronously. The Install-Package cmdlet installs one or more software packages on the local computer. If you have multiple software sources, use Get-PackageProvider and Get-PackageSource to display details about your providers.

Angular 6+ bindings for plyr video and audio player. Supports everything that original library supports.

Installation

TypeScript typings

As long as original plyr does not have yet (sigh) typings, this project has its own at typings/plyr/index.d.ts.

If you have typings issues please refer to the issue #7 for more info.

Demo

Usage

Add 'node_modules/plyr/dist/plyr.css' to the styles section of your angular.json:

Import PlyrModule into the current module's imports:

Finally use plyr in your components as attribute:

or tag (remember that in this case plyr tag has dipslay: inline which cannot accept width, so you need to care of this):

and the component file would have

For using with hls.js and dash.js check the examples and implementation of this project's src/app folder.

API

The API mostly replicates the original Plyr API. See https://github.com/sampotts/plyr for more info

Inputs

  • plyrType: video or audio, see source setters
  • plyrTitle: string, see source setters
  • plyrPoster: poster URL, see source setters
  • plyrSources: array of sources, see source setters
  • plyrTracks: array of tracks, see source setters
  • plyrOptions: initial Plyr options
  • plyrPlaysInline: whether underlying element has playsinline attribute, boolean
  • plyrCrossOrigin: [whether underlying element has crossorigin attribute, boolean
  • plyrDriver: see custom plyr driver

Important: changing plyrOptions, plyrPlaysInline and plyrCrossOrigin will trigger the Plyr reinitialization, since these options cannot be changed on-the-fly

Events

ngx-plyr events:

  • plyrInit: emits a plyr instance when it gets created
  • plyrProgress: replicates original progress event

  • plyrPlaying: replicates original playing event

  • plyrPlay: replicates original play event

  • plyrPause: replicates original pause event

  • plyrTimeUpdate: replicates original timeupdate event

  • plyrVolumeChange: replicates original volumechange event

  • plyrSeeking: replicates original seeking event

  • plyrSeeked: replicates original seeked event

  • plyrRateChange: replicates original ratechange event

  • plyrEnded: replicates original ended event

  • plyrEnterFullScreen: replicates original enterfullscreen event

  • plyrExitFullScreen: replicates original exitfullscreen event

  • plyrCaptionsEnabled: replicates original captionsenabled event

  • plyrCaptionsDisabled: replicates original captionsdisabled event

  • plyrLanguageChange: replicates original languagechange event

  • plyrControlsHidden: replicates original controlshidden event

  • plyrControlsShown: replicates original controlsshown event

  • plyrReady: replicates original ready event

  • plyrLoadStart: replicates original loadstart event

  • plyrLoadedData: replicates original loadeddata event

  • plyrLoadedMetadata: replicates original loadedmetadata event

  • plyrQualityChange: replicates original qualitychange event

  • plyrCanPlay: replicates original canplay event

  • plyrCanPlayThrough: replicates original canplaythrough event Pdf expert 2 5 1.

  • plyrStalled: replicates original stalled event

  • plyrWaiting: replicates original waiting event

  • plyrEmptied: replicates original emptied event

  • plyrCueChange: replicates original cuechange event

  • plyrError: replicates original error event

  • plyrStateChange: replicates original statechange event

Getters and setters / Methods

You can use standard getters and setters and methods by getting Plyr instance from plyrInit.

Vue-plyr npm

Custom Plyr driver

The library allows you to go in its heart by defining a custom Plyr driver. https://lubrcn.over-blog.com/2021/01/file-cabinet-pro-4-0-3-download-free.html. What it means: the hardest stuff is still done for you, but you can apply some actions in the critical points like creating the Plyr instance, updating and destroying it.

This is the right place for integration with other libraries like hls.js, dash.js etc.

M3 data recovery keygen mac. The default implementation looks like this:

You can create your own driver and pass it as input parameter to the plyr component.

Integrations

To integrate the library with hls.js and dash.js see the corresponding demo source code. To integrate others, use same approach with a custom Plyr driver.

Changelog

License

MIT

index.html
<scriptsrc='https://cdn.jsdelivr.net/npm/hls.js'></script>
<scriptsrc='https://unpkg.com/plyr@3'></script>
<scriptsrc='./script.js'></script>
<divclass='container'>
Try adjust different video quality to see it yourself
<videocontrolscrossoriginplaysinline>
<source
type='application/x-mpegURL'
src='https://bitdash-a.akamaihd.net/content/sintel/hls/playlist.m3u8'
>
</video>
</div>
Plyr npm
qbzjvgw.markdown
script.js
document.addEventListener('DOMContentLoaded',()=>{
constvideo=document.querySelector('video');
constsource=video.getElementsByTagName('source')[0].src;
// For more options see: https://github.com/sampotts/plyr/#options
// captions.update is required for captions to work with hls.js
constdefaultOptions={};
if(Hls.isSupported()){
// For more Hls.js options, see https://github.com/dailymotion/hls.js
consthls=newHls();
hls.loadSource(source);
// From the m3u8 playlist, hls parses the manifest and returns
// all available video qualities. This is important, in this approach,
// we will have one source on the Plyr player.
hls.on(Hls.Events.MANIFEST_PARSED,function(event,data){
// Transform available levels into an array of integers (height values).
constavailableQualities=hls.levels.map((l)=>l.height)
// Add new qualities to option
defaultOptions.quality={
default: availableQualities[0],
options: availableQualities,
// this ensures Plyr to use Hls to update quality level
forced: true,
onChange: (e)=>updateQuality(e),
}
// Initialize here
constplayer=newPlyr(video,defaultOptions);
});
hls.attachMedia(video);
window.hls=hls;
}else{
// default options with no quality update in case Hls is not supported
constplayer=newPlyr(video,defaultOptions);
}
functionupdateQuality(newQuality){
console.log(newQuality);
window.hls.levels.forEach((level,levelIndex)=>{
if(level.heightnewQuality){
console.log('Found quality match with '+newQuality);
window.hls.currentLevel=levelIndex;
}
});
}
});
style.css

Plyr Npm React

.container {
padding-top: 18vh;
margin: 20px auto;
width: 600px;
}
video {
width: 100%;
}

Plyr Npm

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment




Plyr Npm
Back to posts
This post has no comments - be the first one!

UNDER MAINTENANCE