
Security News
Security Community Slams MIT-linked Report Claiming AI Powers 80% of Ransomware
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.
@atom-platform/ngx-plyr
Advanced tools
Angular 17+ bindings for [plyr video and audio player](https://github.com/sampotts/plyr). Supports everything that original library supports.
Angular 17+ bindings for plyr video and audio player. Supports everything that original library supports.
npm i plyr @atom-platform/ngx-plyr
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.
Import PlyrModule into the current module's imports:
import { PlyrModule } from '@atom-platform/ngx-plyr';
imports: [
  // ...
  PlyrModule,
],
Finally use plyr in your components as attribute:
<div
  plyr
  style="width: 640px;"
  plyrTitle="Video 1"
  [plyrPlaysInline]="true"
  [plyrSources]="videoSources"
  (plyrInit)="player = $event"
  (plyrPlay)="played($event)"
></div>
<button (click)="play()">Play</button>
or tag (remember that in this case plyr tag has display: inline which cannot accept width, so you need to care of this):
<plyr
  style="display: block; width: 640px;"
  plyrTitle="Video 1"
  [plyrPlaysInline]="true"
  [plyrSources]="videoSources"
  (plyrInit)="player = $event"
  (plyrPlay)="played($event)"
></plyr>
<button (click)="play()">Play</button>
and the component file would have
// get the component instance to have access to plyr instance
@ViewChild(PlyrComponent)
plyr: PlyrComponent;
// or get it from plyrInit event
player: Plyr;
videoSources: Plyr.Source[] = [
  {
    src: 'bTqVqk7FSmY',
    provider: 'youtube',
  },
];
played(event: Plyr.PlyrEvent) {
  console.log('played', event);
}
play(): void {
  this.player.play(); // or this.plyr.player.play()
}
For using with hls.js and dash.js check the examples and implementation of this project's src/app folder.
The API mostly replicates the original Plyr API. See https://github.com/sampotts/plyr for more info
video or audio, see source settersplaysinline attribute, booleancrossorigin attribute, booleanImportant: changing
plyrOptions,plyrPlaysInlineandplyrCrossOriginwill trigger thePlyrreinitialization, since these options cannot be changed on-the-fly
ngx-plyr events:
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
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
You can use standard getters and setters and methods by getting Plyr instance from plyrInit.
The library allows you to go in its heart by defining a custom Plyr driver. 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.
The default implementation looks like this:
import Plyr from "plyr";
import {
  PlyrDriver,
  PlyrDriverCreateParams,
  PlyrDriverUpdateSourceParams,
  PlyrDriverDestroyParams,
} from "./plyr-driver";
export class DefaultPlyrDriver implements PlyrDriver {
  create(params: PlyrDriverCreateParams) {
    return new Plyr(params.videoElement, params.options);
  }
  updateSource(params: PlyrDriverUpdateSourceParams) {
    params.plyr.source = params.source;
  }
  destroy(params: PlyrDriverDestroyParams) {
    params.plyr.destroy();
  }
}
You can create your own driver and pass it as input parameter to the plyr component.
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.
MIT
FAQs
Angular 17+ bindings for [plyr video and audio player](https://github.com/sampotts/plyr). Supports everything that original library supports.
The npm package @atom-platform/ngx-plyr receives a total of 501 weekly downloads. As such, @atom-platform/ngx-plyr popularity was classified as not popular.
We found that @atom-platform/ngx-plyr demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.

Research
/Security News
Socket researchers found 10 typosquatted npm packages that auto-run on install, show fake CAPTCHAs, fingerprint by IP, and deploy a credential stealer.