Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
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
The npm package fluent-amp receives a total of 0 weekly downloads. As such, fluent-amp popularity was classified as not popular.
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
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.