
Research
/Security News
npm Author Qix Compromised via Phishing Email in Major Supply Chain Attack
npm author Qix’s account was compromised, with malicious versions of popular packages like chalk-template, color-convert, and strip-ansi published.
This package is a helper to import the AMP script programmatically into the frontend application. It is mostly useful for frameworks like vue, react and angular where you may not want to manipulate the index.html file yourself and want to create components which is going to benefit from Azure Media Player
.
Note: typescript supported.
Please install the package as below.
npm i fluent-amp
Import the package into your component/project.
import AMPLoader from 'fluent-amp';
Initiate the script like below
AMPLoader
.withVersion() //by default is latest (Not production recommended)
.load()
.then(builder => {
builder.options.fluid = true;
builder.options.autoplay = true;
//Other options will appear here
builder
.forElement('test')
.build({
src: "YOUR_ASSET_ADDRESS",
type: "YOUR_USING_PROTOCOL"
});
})
The way that AMP handles the plugins is first by registering them in the global amp
instance and then use the registered plugin in the player instance.
This package gives you an interface for building your plugin. You should use the AMPPlugin<TOptions>
interface to implement your plugins and then on registering the plugins the AMPBuilder
will give use the method usePlugin
to install your plugins on a player instance.
Let's assume you have implemented the following plugin.
export default class MyPlugin implements AMPPlugin {
name: 'MyPlugin'
install() {
amp.plugin(this.name, function() => {
const player = this;
//Write your plugin logic.
});
}
}
and now you use it as below.
.
.
.
ampBuilder.usePlugin(new MyPlugin());
Please note that it is totally fine the way that AMP natively registers plugins but the issue is when you want to use full type safety(even this method still needs more improvement) and you need to give this a structure so it will be possible to install your plugin just by one method instead of registering it once and adding it to the player's plugin collection.
options
doesn't get an any
type.FAQs
Import the azure media player fluently into your project
We found that fluent-amp demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Research
/Security News
npm author Qix’s account was compromised, with malicious versions of popular packages like chalk-template, color-convert, and strip-ansi published.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.