
Product
Socket Brings Supply Chain Security to skills.sh
Socket is now scanning AI agent skills across multiple languages and ecosystems, detecting malicious behavior before developers install, starting with skills.sh's 60,000+ skills.
tauri-plugin-mpv-api
Advanced tools
A Tauri plugin for embedding the mpv player in your app by controlling its process via JSON IPC.
[!NOTE] Looking for the
[Tauri Plugin libmpv]? It has been moved to a new repository. You can find the latest version here: tauri-plugin-libmpv
A Tauri plugin for embedding the mpv player in your app by controlling its process via JSON IPC.
npm run tauri add mpv
For mpv to properly embed into your Tauri window, you need to configure transparency:
tauri.conf.json{
"app": {
"windows": [
{
"title": "Your App",
"width": 1280,
"height": 720,
"transparent": true // Add this line
}
]
}
}
/* In your main CSS file */
html,
body {
background: transparent;
}
import {
MpvConfig,
init,
observeProperties,
command,
setProperty,
getProperty,
destroy,
} from 'tauri-plugin-mpv-api'
// Properties to observe
const OBSERVED_PROPERTIES = ['pause', 'time-pos', 'duration', 'filename'] as const
// mpv configuration
const mpvConfig: MpvConfig = {
args: [
'--vo=gpu-next',
'--hwdec=auto-safe',
'--keep-open=yes',
'--force-window',
],
observedProperties: OBSERVED_PROPERTIES,
ipcTimeoutMs: 2000,
}
try {
await init(mpvConfig)
console.log('mpv initialization completed successfully!')
} catch (error) {
console.error('mpv initialization failed:', error)
}
// Observe properties
const unlisten = await observeProperties(
OBSERVED_PROPERTIES,
({ name, data }) => {
switch (name) {
case 'pause':
console.log('Playback paused state:', data)
break
case 'time-pos':
console.log('Current time position:', data)
break
case 'duration':
console.log('Duration:', data)
break
case 'filename':
console.log('Current playing file:', data)
break
}
})
// Unlisten when no longer needed
unlisten()
// Use the simple shortcut for most commands
await command('loadfile', ['/path/to/video.mp4'])
await command('seek', [10, 'relative']) // Seek 10 seconds forward
// Use the full object format if you need to provide a custom request_id
await command({ command: ['stop'], request_id: 123 })
// setProperty
await setProperty('volume', 75)
// getProperty
const volume = await getProperty('volume')
console.log('Current volume:', volume)
// Destroy mpv when your app closes or the player is no longer needed
await destroy()
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MPL-2.0 License - see the LICENSE file for details.
FAQs
A Tauri plugin for embedding the mpv player in your app by controlling its process via JSON IPC.
The npm package tauri-plugin-mpv-api receives a total of 17 weekly downloads. As such, tauri-plugin-mpv-api popularity was classified as not popular.
We found that tauri-plugin-mpv-api demonstrated a healthy version release cadence and project activity because the last version was released less than 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.

Product
Socket is now scanning AI agent skills across multiple languages and ecosystems, detecting malicious behavior before developers install, starting with skills.sh's 60,000+ skills.

Product
Socket now supports PHP with full Composer and Packagist integration, enabling developers to search packages, generate SBOMs, and protect their PHP dependencies from supply chain threats.

Security News
An AI agent is merging PRs into major OSS projects and cold-emailing maintainers to drum up more work.