Giter VIP home page Giter VIP logo

mpv.js's Introduction

mpv
mpv.js

All format embeddable player for Electron/NW.js applications.
Powered by marvelous mpv.

Travis NPM

Get libmpv

In order to try mpv.js you need to install mpv library first.

  • Windows: download mpv-dev, unpack, put corresponding mpv-1.dll to C:\Windows\system32
  • macOS: brew install mpv
  • Linux: apt-get install libmpv1 libavformat-dev

Example

Simple Electron application yet capable of handling pretty much any available video thanks to mpv. Run:

git clone https://github.com/Kagami/mpv.js.git && cd mpv.js
npm install
# Only on Linux: npm run use-system-ffmpeg
npm run example

Usage

Add npm package

npm install mpv.js --save

Package includes prebuilt binaries for all major platforms so no need to setup compilers.

Load plugin in main process (Electron example)

const path = require("path");
const {app} = require("electron");
const {getPluginEntry} = require("mpv.js");

// Absolute path to the plugin directory.
const pluginDir = path.join(path.dirname(require.resolve("mpv.js")), "build", "Release");
// See pitfalls section for details.
if (process.platform !== "linux") {process.chdir(pluginDir);}
// Fix for latest Electron.
app.commandLine.appendSwitch("no-sandbox");
// To support a broader number of systems.
app.commandLine.appendSwitch("ignore-gpu-blacklist");
app.commandLine.appendSwitch("register-pepper-plugins", getPluginEntry(pluginDir));

Don't forget to enable plugins feature when creating BrowserWindow:

const win = new BrowserWindow({
  // ...
  webPreferences: {plugins: true},
  // ...
});

Use MPV component (React example)

const React = require("react");
const {ReactMPV} = require("mpv.js");

class Player extends React.PureComponent {
  constructor(props) {
    super(props);
    this.mpv = null;
    this.state = {pause: true, "time-pos": 0};
  }
  handleMPVReady(mpv) {
    this.mpv = mpv;
    this.mpv.observe("pause");
    this.mpv.observe("time-pos");
    this.mpv.command("loadfile", "/path/to/video.mkv");
  }
  handlePropertyChange(name, value) {
    this.setState({[name]: value});
  }
  togglePause() {
    this.mpv.property("pause", !this.state.pause);
  }
  render() {
    return (
      <ReactMPV
        className="player"
        onReady={this.handleMPVReady.bind(this)}
        onPropertyChange={this.handlePropertyChange.bind(this)}
        onMouseDown={this.togglePause.bind(this)}
      />
    );
  }
}

Currently only React component is provided.

See also

Packaging

Basically all you need to ship is mpvjs.node and mpv library. Make sure they both and also Electron/NW.js distribution have the same bitness!

Windows

You may use lachs0r builds. Copy mpv-1.dll to the directory with mpvjs.node and you are done.

macOS

Homebrew can compile libmpv.1.dylib and all its dependencies. To find dylibs that need to be packaged and fix install names you may use collect-dylib-deps script.

Linux

Two options are normally acceptable:

  1. Ask your users to install libmpv1 with package manager or simply depend on it if you build package.
  2. Compile static libmpv.so with e.g. mpv-build.

Pitfalls

Path to plugin can't contain non-ASCII symbols

This is unfortunate Chromium's pepper_plugin_list.cc restriction. To workaround this relative path might be used.

On Windows and Mac it can be done by changing working directory to the path where mpvjs.node is stored. You can't change CWD of renderer process on Linux inside main process because of zygote architecture so another fix is just cd to the plugin directory in wrapper script.

getPluginEntry helper will give you plugin entry string with that fix applied.

libmpv is being linked with Electron's libffmpeg on Linux

On Linux plugins loaded with register-pepper-plugins inherit symbols from electron binary so it leads to unfortunate effect: libmpv will use Electron's libraries which is not supported.

To workaround it you need to either replace libffmpeg.so with empty wrapper linked to libav*:

gcc -Wl,--no-as-needed -shared -lavformat -o /path/to/libffmpeg.so

Or use libmpv with statically linked libav*.

Build on x86

To build mpvjs.node by yourself you need to setup dev environment.

Step 1: setup node-gyp

See installation section.

  • Windows: Visual Studio 2013 is required

Step 2: setup NaCl SDK

See download page.

  • Windows: unpack nacl_sdk.zip to C:\
  • macOS & Linux: add export NACL_SDK_ROOT=/path/to/pepper_49 to ~/.bash_profile

Step 2.1: compile 64-bit NaCl host binaries on Windows

  1. Open C:\nacl_sdk\pepper_49\tools\host_vc.mk and replace 32_host with 64_host
  2. Open cmd, run "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" amd64
  3. Run cd C:\nacl_sdk\pepper_49\src and make TOOLCHAIN=win PROJECTS="ppapi_cpp ppapi_gles2"

Step 3: setup mpv development files

  • Windows: download mpv-dev, unpack to C:\mpv-dev
  • macOS: brew install mpv
  • Linux: apt-get install libmpv-dev

Step 4: build plugin

  • Run node-gyp rebuild in project directory
  • Run node-gyp rebuild --arch=ia32 to build 32-bit version of plugin on 64-bit Windows

Build on ARM

Important: Electron 1.8.x ARM releases are broken so use 2.x or 1.7.x instead.

Note: instructions below have been tested on Raspberry Pi 3, see more.

Step 0: enable hardware graphics acceleration

  • Run sudo raspi-config
  • Select Advanced Options, then select GL Driver and then GL (Full KMS) OpenGL desktop driver with full KMS. When configuration is finished you will see following message: "Full KMS GL driver is enabled"
  • Select <Ok> and then <Finish> and raspi-config tool will ask you if you would like to reboot
  • Select <Yes> to reboot the system and apply configuration changes

Step 1: setup node-gyp

See installation section.

Step 2: setup NaCl SDK

The NaCl SDK itself is only built to run on x86, so you can't use ./naclsdk. Instead you have to download pepper's archive directly and unpack it to some directory. Then add export NACL_SDK_ROOT=/path/to/pepper_49 to ~/.bash_profile.

Step 3: setup mpv development files

apt-get install libmpv-dev

Step 4: compile ARM host binaries

Run cd /path/to/pepper_49/src and make TOOLCHAIN=linux PROJECTS="ppapi_cpp ppapi_gles2" CFLAGS="-D_GLIBCXX_USE_CXX11_ABI=0".

Step 5: build plugin

After the process is done, head back to mpv.js directory and run node-gyp rebuild.

Applications using mpv.js

Feel free to PR your own.

License

mpv.js is licensed under CC0 itself. However if you use GPL build of libmpv (e.g. lachs0r builds) your application might violate GPL dynamic linking restrictions. LGPL build should be safe, see mpv copyright for details. (This is not a legal advice.)

Example video is part of Tears of Steel movie (CC) Blender Foundation | mango.blender.org.

Logo is by @SteveJobzniak.

mpv.js's People

Contributors

dependabot[bot] avatar kagami avatar peter23 avatar qsniyg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mpv.js's Issues

onError callback

Makes sense to be able to receive notifications for e.g. failed commands. Might also use Promise API for API methods.

Support for mpv 0.28.0

Hi, any plans to support the latest mpv version? (released Dec 25th)

Something seems to be broken at the moment.

v47 prebuilds

when trying to build my application, it looks for releases in the repo marked for v47, but it only finds for v42. any other way of solving it apart from building my own?

not able to apply video filter

Hi Kagami,

I'm try to using video filter with mpv.js. It works for command line version of mpv:

'''
mpv THE_BRIDGE.avi --vf=lavfi=[gradfun=20:30,vflip]
'''
The video will be flipped while playing.

I tried to do the same thing from mpv.js, by using reactmpv's property method:

'''
this.mpv.property('vf', "lavfi=[gradfun=20:30,vflip]");
'''

But the mpv.js just stopped work, and nothing else happened.

Could you please let me know the correct way to do it? Thanks.

Edward.

Is there a way to debug compatible issue?

Hi Kagami,

I'm working on a video player for macOS, which use mpv.js as its video playback engine.

Most of the users use this player just fine, everything works perfectly.

But some of them complained that they can not play any mkv files. The video player displayed a green screen only (audio is ok).

I'm not quite clear about what happened. Is there anyway to get some useful debug info from mpv.js?

BTW, I suspected it is related to hardware decoding. But the default settings of hardware decoding is off (hwdec=no). So this is probably a dead end.

I also tried to set another value for vo, but from the doc of mpv.io, I can not find a reasonable value to replace the default "gpu" one.

So now I'm blocked by this problem, any suggestion is highly welcome, thanks!

cannot work in windows 32bit

Dear Kagami, when i pack with 'electron-packager' for windows 32bit, it just cannot work. tips 'Cannot load plug-ins'. Curiously, it work in 64bit. what can I do.

How to listen stream stop event ?

I use mpv.js to play .flv live stream. I need to know the stream end event happen and display end message, I have tried observe 'eof-reached' and 'stream-end', but neither emitted when the stream stop.

Handle complex properties + Promise API

currently there is no method for getting a property value like mp.get_property. sure there is mpv.observe but it's not useful for some properties like track-list

the following code demonstrates why:

  handleMPVReady (mpv) {
    this.mpv = mpv
    this.mpv.observe("track-list")
    this.mpv.observe("track-list/count")
  }

  handlePropertyChange(name, value) {
    if (name === 'track-list') console.log(value) // noting, where it should be an array
    if (name === 'track-list/count') console.log(value) // integer
  }

so in order to find out the number of subtitles that are available for the current file and then cycle through them first you have to find the number of tracks then observe each track individually like
this.mpv.observe('track-list/0/type').

my workaround

since #24 is solved. I can load a custom script that uses mp.get_property('track-list') and then spawn PowerShell to write the result into a temporary file. and then with fs.watch and fs.createReadStream feed the result into renderer process.

script.js

mp.set_property('sub-auto', 'fuzzy')

var getTempDir = function () {
  var temp = mp.utils.getenv('TEMP') || mp.utils.getenv('TEP')
  if (temp) return temp
  else return '/tmp'
}

mp.register_event('file-loaded', function () {
  var trackList = mp.get_property('track-list')
  var cmds = ['powershell', "'" + trackList + "' | Out-File -Encoding 'UTF8' " + getTempDir() + '\\mpvdata.json']
  var result = mp.utils.subprocess({
    args: cmds
  })
})

renderer.js

  handleMPVReady (mpv) {
    this.mpv = mpv
    this.mpv.command('load-script', path.join(__dirname, 'mpv', 'config', 'scripts', 'index.js'))
    const observe = mpv.observe.bind(mpv);
    ['pause', 'time-pos', 'duration', 'eof-reached', 'volume', 'mute'].forEach(observe)
  }


  handleLoad (e) {
    e.target.blur()
    const items = remote.dialog.showOpenDialog({filters: [
      {name: 'Videos', extensions: ['mkv', 'mp4', 'mov', 'avi']},
      {name: 'All files', extensions: ['*']}
    ]})
    if (items) {
      this.mpv.command('loadfile', items[0])
      this.mpv.property('pause', false)
      let trackList = ''
      setTimeout(() => {
        fs.createReadStream(path.join(os.tmpdir(), 'mpvdata.json'))
          .on('data', (chunks) => {
            trackList += chunks
          })
          .on('end', () => {
            console.log(trackList)
          })
      }, 1000)
    }
  }

it is not an accurate solution because:

  • this only works on windows.
  • if powershell fails I have to ether close the MPV process. or ignore the functionality that uses track-list in my program.

mpv crashes when loading custom scripts

I followed the documentation on lua scripting and since options can be set as runtime via properties as well the following line should load my custom script

this.mpv.property('script', path.join(__dirname, 'mpv_commons.lua'))

but instead it just crashed

os: windows 10_x64 build 16299
electron: 1.8.4

screenshots

[libmpv_render] fails to render textures

due to a perfectly legitimate desire to maintain backward compatibility with older Raspberry models, the repository only provides a generic build of mpv (and an older version of FFmpeg). As a result, mpv is unable to take advantage of hardware acceleration, and therefore does not leverage the Raspberry’s surprisingly powerful on-board GPU to play video. So I used mpv-build to build FFmpeg and MPV from their master branch. with these options.

ffmpeg:

--enable-gpl
--enable-nonfree
--enable-static
--enable-libx264
 --enable-libfdk-aac
 --enable-libvpx
 --enable-libopus
 --enable-libmp3lame
 --enable-libtheora
 --enable-libvorbis
 --enable-omx
 --enable-omx-rpi
 --enable-mmal
 --enable-libxcb
 --enable-libfreetype
 --enable-libass
 --enable-gnutls
 --disable-opencl
 --extra-cflags="-march=armv8-a+crc -mfpu=neon-fp-armv8 -mtune=cortex-a53"

mpv:

--enable-rpi
--enable-libmpv-shared

the result is astonishing, MPV (player itself) can play 1080P/60fps videos without dropping a single frame.
but libmpv will show a white screen that can only play the sounds and render subtitles. logs from MPV_TERMINAL indicate these errors:

[libmpv_render] after creating texture: OpenGL error INVALID_VALUE.
[libmpv_render] Error: framebuffer completeness check failed (error=36054).
[libmpv_render] Error: texture could not be created.

I've already rebuild the plugin, but the issue remains. also this is sort of similar to #25 but i've tried it with 1.7.9 as well.

Couldn't load plugin.

When I run the example app I get the message "Couldn't load plugin." in the middle of the electron window. Perhaps I am using incompatible versions?
Thanks!

Environment:

Ubuntu 18.04.1 LTS 64bit
$ electron --version v3.0.10
$ node --version v10.11.0

$ mpv --version
mpv 0.27.2 (C) 2000-2017 mpv/MPlayer/mplayer2 projects
 built on UNKNOWN
ffmpeg library versions:
   libavutil       55.78.100
   libavcodec      57.107.100
   libavformat     57.83.100
   libswscale      4.8.100
   libavfilter     6.107.100
   libswresample   2.9.100
ffmpeg version: 3.4.4-0ubuntu0.18.04.1

$ readelf -d node_modules/electron/dist/libffmpeg.so
Dynamic section at offset 0xe40 contains 22 entries:
  Tag        Type                         Name/Value
 0x0000000000000001 (NEEDED)             Shared library: [libavformat.so.57]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
 0x000000000000000c (INIT)               0x460
 0x000000000000000d (FINI)               0x57c
 0x0000000000000019 (INIT_ARRAY)         0x200e30
 0x000000000000001b (INIT_ARRAYSZ)       8 (bytes)
 0x000000000000001a (FINI_ARRAY)         0x200e38
 0x000000000000001c (FINI_ARRAYSZ)       8 (bytes)
 0x000000006ffffef5 (GNU_HASH)           0x1b8
 0x0000000000000005 (STRTAB)             0x2e0
 0x0000000000000006 (SYMTAB)             0x1f0
 0x000000000000000a (STRSZ)              161 (bytes)
 0x000000000000000b (SYMENT)             24 (bytes)
 0x0000000000000003 (PLTGOT)             0x201000
 0x0000000000000007 (RELA)               0x3b8
 0x0000000000000008 (RELASZ)             168 (bytes)
 0x0000000000000009 (RELAENT)            24 (bytes)
 0x000000006ffffffe (VERNEED)            0x398
 0x000000006fffffff (VERNEEDNUM)         1
 0x000000006ffffff0 (VERSYM)             0x382
 0x000000006ffffff9 (RELACOUNT)          3
 0x0000000000000000 (NULL)               0x0

build on ARMhf7

both mpv and pepper_49 support ARM. so I tried to build this project with libraries under /pepper_49/lib/glibc_arm although lppapi is missing so I copied the one under linux_host.

and to put everyting together. I used electron 1.8.7 on RaspberryPi 3 (armhf7)
somehow it faild to even load the page. so I used 2.0.7. now it says "couldn't load the plugin". so any advice?

Subtitles

How can I work with subtitles?
It will not automatically associate

Issue while building on Windows: error LNK2001: unresolved external symbol GLES2CreateProgram

I followed the instructions and didn't have any issues until I ran "node-gyp rebuild". Specifically I'm seeing "error LNK2001: unresolved external symbol GLES2CreateProgram".

The binding.gyp specifically says: "C:/nacl_sdk/pepper_49/lib/win_x86_64_host/Release" and that's where the ppapi_cpp.lib and ppapi_gles2.lib files are located. (I can past the path into file explorer and I see the two files and they're last modified when I made them).

node-gyp rebuild
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | win32 | x64
gyp info find Python using Python version 2.7.15 found at "C:\Python27\python.exe"
gyp info find VS using VS2017 (15.9.28307.344) found at:
gyp info find VS "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools"
gyp info find VS run with --verbose for detailed information
gyp info spawn C:\Python27\python.exe
gyp info spawn args [ 'C:\\Users\\sirisian\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\gyp\\gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'msvs',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\sirisian\\Desktop\\git\\mpv.js\\build\\config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\sirisian\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\sirisian\\AppData\\Local\\node-gyp\\Cache\\11.9.0\\include\\node\\common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=C:\\Users\\sirisian\\AppData\\Local\\node-gyp\\Cache\\11.9.0',
gyp info spawn args   '-Dnode_gyp_dir=C:\\Users\\sirisian\\AppData\\Roaming\\npm\\node_modules\\node-gyp',
gyp info spawn args   '-Dnode_lib_file=C:\\Users\\sirisian\\AppData\\Local\\node-gyp\\Cache\\11.9.0\\<(target_arch)\\node.lib',
gyp info spawn args   '-Dmodule_root_dir=C:\\Users\\sirisian\\Desktop\\git\\mpv.js',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'C:\\Users\\sirisian\\Desktop\\git\\mpv.js\\build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp info spawn C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe
gyp info spawn args [ 'build/binding.sln',
gyp info spawn args   '/clp:Verbosity=minimal',
gyp info spawn args   '/nologo',
gyp info spawn args   '/p:Configuration=Release;Platform=x64' ]
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  index.cc
index.obj : error LNK2001: unresolved external symbol GLES2CreateProgram [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol GLES2BindFramebuffer [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol GLES2DrawArrays [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol GLES2GetIntegerv [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol GLES2TexImage2D [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol GLES2BufferData [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol GLES2VertexAttribPointer [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol GLES2IsQueryEXT [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol GLES2LinkProgram [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol GLES2DeleteShader [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol GLES2Disable [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol GLES2Uniform1i [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol GLES2GetProgramiv [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol GLES2EnableVertexAttribArray [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol GLES2TexSubImage2D [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol GLES2AttachShader [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol GLES2Uniform1f [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol GLES2GetError [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol "public: void __cdecl pp::Instance::PostMessage(class pp::Var const &)" (?PostMessage@Instance@pp@@QEAAXAEBVVar@2@@Z) [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol "public: bool __cdecl pp::Instance::BindGraphics(class pp::Graphics3D const &)" (?BindGraphics@Instance@pp@@QEAA_NAEBVGraphics3D@2@@Z) [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol "public: virtual bool __cdecl pp::Instance::HandleDocumentLoad(class pp::URLLoader const &)" (?HandleDocumentLoad@Instance@pp@@UEAA_NAEBVURLLoader@2@@Z) [C:\Users\sirisian\Desktop\git\mpv.js\build\
mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol "public: virtual bool __cdecl pp::Instance::HandleInputEvent(class pp::InputEvent const &)" (?HandleInputEvent@Instance@pp@@UEAA_NAEBVInputEvent@2@@Z) [C:\Users\sirisian\Desktop\git\mpv.js\build\mp
vjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl pp::Instance::DidChangeFocus(bool)" (?DidChangeFocus@Instance@pp@@UEAAX_N@Z) [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl pp::Instance::DidChangeView(class pp::Rect const &,class pp::Rect const &)" (?DidChangeView@Instance@pp@@UEAAXAEBVRect@2@0@Z) [C:\Users\sirisian\Desktop\git\mpv.js\bui
ld\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol "public: virtual __cdecl pp::Instance::~Instance(void)" (??1Instance@pp@@UEAA@XZ) [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol "public: __cdecl pp::Instance::Instance(int)" (??0Instance@pp@@QEAA@H@Z) [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol "public: void __cdecl pp::Lock::Release(void)" (?Release@Lock@pp@@QEAAXXZ) [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol "public: void __cdecl pp::Lock::Acquire(void)" (?Acquire@Lock@pp@@QEAAXXZ) [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol "public: __cdecl pp::Lock::~Lock(void)" (??1Lock@pp@@QEAA@XZ) [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol "public: __cdecl pp::Lock::Lock(void)" (??0Lock@pp@@QEAA@XZ) [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl pp::Var::AsString(void)const " (?AsString@Var@pp@@QEBA?AV?$basic_string@DU?$char_traits@D@s
td@@V?$allocator@D@2@@std@@XZ) [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol "public: double __cdecl pp::Var::AsDouble(void)const " (?AsDouble@Var@pp@@QEBANXZ) [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol "public: int __cdecl pp::Var::AsInt(void)const " (?AsInt@Var@pp@@QEBAHXZ) [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol "public: bool __cdecl pp::Var::AsBool(void)const " (?AsBool@Var@pp@@QEBA_NXZ) [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol "public: virtual __cdecl pp::Var::~Var(void)" (??1Var@pp@@UEAA@XZ) [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol "public: __cdecl pp::Var::Var(struct pp::Var::Null)" (??0Var@pp@@QEAA@UNull@01@@Z) [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol "public: __cdecl pp::Var::Var(bool)" (??0Var@pp@@QEAA@_N@Z) [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol "public: __cdecl pp::Var::Var(int)" (??0Var@pp@@QEAA@H@Z) [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol "public: __cdecl pp::Var::Var(double)" (??0Var@pp@@QEAA@N@Z) [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol "public: __cdecl pp::Var::Var(char const *)" (??0Var@pp@@QEAA@PEBD@Z) [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol "public: class pp::Resource & __cdecl pp::Resource::operator=(class pp::Resource const &)" (??4Resource@pp@@QEAAAEAV01@AEBV01@@Z) [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol "public: virtual bool __cdecl pp::Module::Init(void)" (?Init@Module@pp@@UEAA_NXZ) [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol "public: static class pp::Module * __cdecl pp::Module::Get(void)" (?Get@Module@pp@@SAPEAV12@XZ) [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol "public: virtual __cdecl pp::Module::~Module(void)" (??1Module@pp@@UEAA@XZ) [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol "public: __cdecl pp::Module::Module(void)" (??0Module@pp@@QEAA@XZ) [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol "public: float __cdecl pp::View::GetDeviceScale(void)const " (?GetDeviceScale@View@pp@@QEBAMXZ) [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol "public: class pp::Rect __cdecl pp::View::GetRect(void)const " (?GetRect@View@pp@@QEBA?AVRect@2@XZ) [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol "public: unsigned int __cdecl pp::VarArray::GetLength(void)const " (?GetLength@VarArray@pp@@QEBAIXZ) [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol "public: class pp::Var __cdecl pp::VarArray::Get(unsigned int)const " (?Get@VarArray@pp@@QEBA?AVVar@2@I@Z) [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol "public: virtual __cdecl pp::VarArray::~VarArray(void)" (??1VarArray@pp@@UEAA@XZ) [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol "public: __cdecl pp::VarArray::VarArray(class pp::Var const &)" (??0VarArray@pp@@QEAA@AEBVVar@1@@Z) [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol "public: bool __cdecl pp::VarDictionary::Set(class pp::Var const &,class pp::Var const &)" (?Set@VarDictionary@pp@@QEAA_NAEBVVar@2@0@Z) [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol "public: class pp::Var __cdecl pp::VarDictionary::Get(class pp::Var const &)const " (?Get@VarDictionary@pp@@QEBA?AVVar@2@AEBV32@@Z) [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol "public: virtual __cdecl pp::VarDictionary::~VarDictionary(void)" (??1VarDictionary@pp@@UEAA@XZ) [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol "public: __cdecl pp::VarDictionary::VarDictionary(void)" (??0VarDictionary@pp@@QEAA@XZ) [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol "public: __cdecl pp::VarDictionary::VarDictionary(class pp::Var const &)" (??0VarDictionary@pp@@QEAA@AEBVVar@1@@Z) [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol "public: __cdecl pp::InstanceHandle::InstanceHandle(class pp::Instance *)" (??0InstanceHandle@pp@@QEAA@PEAVInstance@1@@Z) [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol "public: void __cdecl pp::Core::CallOnMainThread(int,class pp::CompletionCallback const &,int)" (?CallOnMainThread@Core@pp@@QEAAXHAEBVCompletionCallback@2@H@Z) [C:\Users\sirisian\Desktop\git\mpv.js
\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol "public: int __cdecl pp::Graphics3D::SwapBuffers(class pp::CompletionCallback const &)" (?SwapBuffers@Graphics3D@pp@@QEAAHAEBVCompletionCallback@2@@Z) [C:\Users\sirisian\Desktop\git\mpv.js\build\mp
vjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol "public: int __cdecl pp::Graphics3D::ResizeBuffers(int,int)" (?ResizeBuffers@Graphics3D@pp@@QEAAHHH@Z) [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol "public: virtual __cdecl pp::Graphics3D::~Graphics3D(void)" (??1Graphics3D@pp@@UEAA@XZ) [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol "public: __cdecl pp::Graphics3D::Graphics3D(void)" (??0Graphics3D@pp@@QEAA@XZ) [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol "public: __cdecl pp::Graphics3D::Graphics3D(class pp::InstanceHandle const &,int const * const)" (??0Graphics3D@pp@@QEAA@AEBVInstanceHandle@1@QEBH@Z) [C:\Users\sirisian\Desktop\git\mpv.js\build\mpv
js.vcxproj]
index.obj : error LNK2001: unresolved external symbol GLES2BindAttribLocation [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol GLES2GenBuffers [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol GLES2Flush [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol GLES2DisableVertexAttribArray [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol GLES2Finish [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol GLES2GetQueryObjectuivEXT [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol GLES2UseProgram [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol GLES2ShaderSource [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol GLES2ClearColor [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol GLES2Enable [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol GLES2BindBuffer [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol GLES2UniformMatrix2fv [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol GLES2GetUniformLocation [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol GLES2GetAttribLocation [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol GLES2EndQueryEXT [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol GLES2PixelStorei [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol GLES2DeleteTextures [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol GLES2DeleteBuffers [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol glInitializePPAPI [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol GLES2GenQueriesEXT [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol GLES2DeleteFramebuffers [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol GLES2CompileShader [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol GLES2BufferSubData [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol GLES2UniformMatrix3fv [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol GLES2GenTextures [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol GLES2Uniform3f [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol GLES2FramebufferTexture2D [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol GLES2Scissor [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol GLES2GenFramebuffers [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol GLES2Viewport [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol GLES2CreateShader [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol GLES2TexParameteri [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol GLES2GetString [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol GLES2Clear [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol GLES2BindTexture [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol GLES2DeleteQueriesEXT [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol GLES2CheckFramebufferStatus [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol GLES2ActiveTexture [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol GLES2BeginQueryEXT [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol GLES2ReadPixels [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol GLES2GetShaderiv [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol GLES2BlendFuncSeparate [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol GLES2Uniform2f [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol GLES2GetProgramInfoLog [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol GLES2GetShaderInfoLog [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol glSetCurrentContextPPAPI [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol GLES2GetFramebufferAttachmentParameteriv [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
index.obj : error LNK2001: unresolved external symbol GLES2DeleteProgram [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
C:\Users\sirisian\Desktop\git\mpv.js\build\Release\mpvjs.node : fatal error LNK1120: 111 unresolved externals [C:\Users\sirisian\Desktop\git\mpv.js\build\mpvjs.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Users\sirisian\AppData\Roaming\npm\node_modules\node-gyp\lib\build.js:196:23)
gyp ERR! stack     at ChildProcess.emit (events.js:197:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:254:12)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\sirisian\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\sirisian\Desktop\git\mpv.js
gyp ERR! node -v v11.9.0
gyp ERR! node-gyp -v v5.0.3
gyp ERR! not ok

(I have no issues getting this to work with Ubuntu 18.04).

"Couldn't load plugin" on Ubuntu 16.04

I downloaded the git example, and run it.
But can't working on the ubuntu 16.04.
I installed the mpv using apt-get.And the mpv player can working successfully.
Please help me, I tryed it's OK on windows 10, but in ubuntu 16.04 is failture.

not working on armbian orange pi

When I try to start the application it displays the following

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'example' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'preexample', 'example', 'postexample' ]
5 info lifecycle [email protected]~preexample: [email protected]
6 info lifecycle [email protected]~example: [email protected]
7 verbose lifecycle [email protected]~example: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]~example: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/max/build/mpv.js/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
9 verbose lifecycle [email protected]~example: CWD: /home/max/build/mpv.js
10 silly lifecycle [email protected]~example: Args: [ '-c', 'electron example' ]
11 silly lifecycle [email protected]~example: Returned: code: 1  signal: null
12 info lifecycle [email protected]~example: Failed to exec example script
13 verbose stack Error: [email protected] example: `electron example`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
13 verbose stack     at EventEmitter.emit (events.js:198:13)
13 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:198:13)
13 verbose stack     at maybeClose (internal/child_process.js:982:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
14 verbose pkgid [email protected]
15 verbose cwd /home/max/build/mpv.js
16 verbose Linux 3.4.113-sun8i
17 verbose argv "/u0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'example' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'preexample', 'example', 'postexample' ]
5 info lifecycle [email protected]~preexample: [email protected]
6 info lifecycle [email protected]~example: [email protected]
7 verbose lifecycle [email protected]~example: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]~example: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/max/build/mpv.js/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
9 verbose lifecycle [email protected]~example: CWD: /home/max/build/mpv.js
10 silly lifecycle [email protected]~example: Args: [ '-c', 'electron example' ]
11 silly lifecycle [email protected]~example: Returned: code: 1  signal: null
12 info lifecycle [email protected]~example: Failed to exec example script
13 verbose stack Error: [email protected] example: `electron example`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
13 verbose stack     at EventEmitter.emit (events.js:198:13)
13 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:198:13)
13 verbose stack     at maybeClose (internal/child_process.js:982:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
14 verbose pkgid [email protected]
15 verbose cwd /home/max/build/mpv.js
16 verbose Linux 3.4.113-sun8i
17 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "example"
18 verbose node v10.16.3
19 verbose npm  v6.9.0
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] example: `electron example`
22 error Exit status 1
23 error Failed at the [email protected] example script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
sr/local/bin/node" "/usr/local/bin/npm" "run" "example"
18 verbose node v10.16.3
19 verbose npm  v6.9.0
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] example: `electron example`
22 error Exit status 1
23 error Failed at the [email protected] example script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

electron version is 2.0.18

"loadfile" command with additional arguments

I'm trying to call a "loadfile" command with additional arguments. Like :
this.mpv.command('loadfile', 'file://' + PATH_TO_FILE, 'replace', ["--start=0", "--end=10"])

In this case video is not loading at all. Can you help ?

Plug-in can not be loaded

hi I encountered some problems. i use ubuntu 16.04.

mpv-build install ok;

$ ls /usr/include/mpv 
client.h  opengl_cb.h  qthelper.hpp

$ tree -I node_modules
.
├── binding.gyp
├── build
│   └── Release
│       └── mpvjs.node
├── COPYING
├── example
│   ├── index.html
│   ├── index.js
│   ├── mpv
│   │   └── mpvjs.node
│   ├── renderer.js
│   └── tos.mkv
├── index.cc
├── index.js
├── libffmpeg.so
├── package.json
├── README.md
├── scripts
│   └── collect-dylib-deps.sh
└── yarn.lock

gcc -shared -lavformat -o node_modules/electron/dist/libffmpeg.so 
/usr/bin/ld: not found -lavformat

Please help me to see

Prerequisites for build on Windows

Hi,

This seems like a very nice approach for supporting all these video file formats in electron apps.

Are there any prerequisites for the build to work on Windows? Any SDKs that I should install first, and build after?

I don't really have any experience with plugins and how they integrate with electron

OpenGL error in electron 2.0.0

electron 2.0.0 was released yesterday and I tried it with mpv.js. everything looks fine but I get this Error message in my console. it doesn't seems to be affecting the player functionality but nevertheless it's an error.

os: windows 10_x64 build 16299
electron: 2.0.0

[11664:0503/170106.364:ERROR:texture_manager.cc(2437)] [.PPAPIContext]GL ERROR :GL_INVALID_VALUE : glTexImage2D: invalid internal_format GL_RGBA16_EXT
[opengl-cb] after creating texture: OpenGL error INVALID_VALUE.
[opengl-cb] Error: framebuffer completeness check failed (error=36054).
[opengl-cb] Error: texture could not be created.

Can I embed this plugin into the webpage?

The example you gave is embedded in the desktop application. If I want to embed this plugin into the webpage, can I do it? What should I do? Is there a relevant example?

`command` not working on example

Video is not playing after pressing play (or trying to load another video) when doing npm run example on master.

It works if I manually override and put mpv_command(mpv_, "loadfile", "path/to/video", NULL); with the exact same strings that were passed.

PS: On macOS 10.12.3.

Plugin could not be loaded error

Hello, I am trying to get this awesome, awesome project to work in my electron app. However, I am struggling with getting it to run. I put the code from

Load plugin in main process (Electron example)

of your readme to the electron-starter.js file that the electron quick start app generates, e.g. the file that boots up electron and creates a window. Here is a full gist of that file. However, all I see is an error saying that the plugin could not be loaded.

Can you help?

Subtitles

How can I work with subtitles.
for example:

  1. load subtitles from video;
  2. add subtitles to video.

Impossible to run it on systems without OpenGL (without video drivers)

In such cases plugin can not be loaded and message
failed to initialize mpv GL context
can be seen in the console.

This problem happens for example on virtual machines without guest OS tools installed.

I know that playing video through OpenGL is a really good way.
But I think also will be good to have some fallback option to run it on systems without OpenGL.

Set mpv options (e.g. --loop-file=inf)?

How do you set the --loop-file option to inf?

It would seem this is not a property. Attempting to set it as a property causes the Electron app to crash. I've tried sending it as a command as well to no avail. I think you need to set this option prior to the embed but I'm not certain if there's a way to do that with mpv.js?

Thanks.

(P.S. This is an amazing library. I've currently got it running in an Ember powered Electron app.)

Couldn't load plugin.

I'm trying to run example, but react can't render Player component. It's just say "Couldn't load plugin."
Any ideas how to fix this?

"Couldn't load plugin" on Electron 5.0.5

While the example code with Electron 1.8.8 woks great, as soon as I upgrade the electron version I get "Couldn't load plugin".

Is there something else I need to do to get it working? I've re-run npm install and there's nothing in the terminal or browser dev tools console. It appears in navigator.plugins in the browser.

Hardware Acceleration

Hi Kagami,

I was able to use your plugin to with GPU acceleration by changing vo from opengl-cb to default and hwdec to various values. Full screen videos play much faster but are not rendered within the browser window.

My goal is a full screen accelerated render of videos alternating with HTML content, so it would be nice if I could get this to work as a plugin rather than find a way to control the window that mpv creates.

Is it the case that opengl-cb video output necessary for a ppapi plugin to render in the browser window?

I know this is outside the original purpose of your plugin, but do you have any advice in this area?

Thanks.

feat: Standalone app

It would be great if we could pack everything in one stand alone app instead to mess around with brew/apt or moving files into system32.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.