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.
nativescript-sound
Advanced tools
Play a sound in your NativeScript app.
Run the following command from the root of your project:
tns plugin add nativescript-sound
To use this plugin you must first require() it:
var sound = require("nativescript-sound");
It's important to preload the audio file into the sound module before playing it; there is a delay during creation due to the audio being processed:
var tada = sound.create("~/sounds/tada.mp3"); // preload the audio file
// play the sound (i.e. tap event handler)
tada.play();
A good way to do this is to create a sound collection:
sounds = {
"Tada": sound.create("~/sounds/tada.mp3"),
"Boo": sound.create("~/sounds/boo.mp3"),
// ...
};
If you wish to play a sound due to a button being tapped, leverage the following code (where name
refers to the name of the audio file to be played):
this.playButtonPressed = function(name) {
if (app.android) {
sounds[name].play();
} else {
var soundFile = sound.create("~/sounds/" + name + ".mp3");
soundFile.play();
}
}
tada.stop();
tada.reset();
FAQs
Play a sound in your NativeScript app
The npm package nativescript-sound receives a total of 8 weekly downloads. As such, nativescript-sound popularity was classified as not popular.
We found that nativescript-sound 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.