Giter Site home page Giter Site logo

mpv-remote-app's People

Contributors

elig0n avatar marcopus avatar mcastorina avatar morrah 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mpv-remote-app's Issues

Display timestamp

Have a way to display timestamp. Options include:

  • while seeking
  • dedicated button
  • in app timestamp synced to server

Error setting property - unable to control mpv

I am able to communicate from the Android app to the python server, however every command sent to mpv comes back failed. Here is some of the output:
{'time': 1546583672857, 'value': True, 'command': 'set', 'property': 'pause'}
Error setting property: pause = True
ACK {"message": null, "time": 1546583672952, "action": 1546583672857, "result": false}
{'time': 1546583701036, 'value': True, 'command': 'set', 'property': 'pause'}
Error setting property: pause = True
ACK {"message": null, "time": 1546583701129, "action": 1546583701036, "result": false}
{'time': 1546583701852, 'value': True, 'command': 'set', 'property': 'pause'}
Error setting property: pause = True
ACK {"message": null, "time": 1546583701944, "action": 1546583701852, "result": false}
{'time': 1546583745526, 'value': 59, 'command': 'set', 'property': 'volume'}
Error setting property: volume = 59
ACK {"message": null, "time": 1546583745618, "action": 1546583745526, "result": false}
{'pre': None, 'post': '%', 'time': 1546583745542, 'command': 'show', 'property': 'volume'}
ACK {"message": "", "time": 1546583745630, "action": 1546583745542, "result": true}
{'time': 1546583745550, 'value': True, 'command': 'set', 'property': 'pause'}
Error setting property: pause = True
ACK {"message": null, "time": 1546583745640, "action": 1546583745550, "result": false}
{'time': 1546583745932, 'value': True, 'command': 'set', 'property': 'pause'}
Error setting property: pause = True
ACK {"message": null, "time": 1546583746023, "action": 1546583745932, "result": false}
{'time': 1546583763872, 'value': True, 'command': 'set', 'property': 'fullscreen'}
Error setting property: fullscreen = True
ACK {"message": null, "time": 1546583763966, "action": 1546583763872, "result": false}

I can confirm mpv is started with the --input-ipc-server mpv_socket option.

mpv git-2018-11-18-ce2253b Copyright © 2000-2018 mpv/MPlayer/mplayer2 projects
built on Mon Dec 17 05:57:11 UTC 2018
ffmpeg library versions:
libavutil 56.24.101
libavcodec 58.42.102
libavformat 58.24.101
libswscale 5.4.100
libavfilter 7.46.101
libswresample 3.4.100
ffmpeg version: git-2018-12-16-de5e71f

Handle shared data [urls] from other apps

mpv relies on youtube-dl to play videos from various services and accepts urls as input.
Handling ACTION_SEND intent for shared urls from other apps by mpv-remote and passing those urls to mpv to play or to add into a queue would drastically improve the user experience.

Save path after browsing library

Spawning the Library Activity will always start at the server's root directory. It is more convenient to save the last directory that was navigated to.

Server does not work on Windows

Windows 10 user
powershell showing this error

was running as admin

PS C:\Users\manan> mpv-remote-app password
Traceback (most recent call last):
File "c:\users\manan\appdata\local\programs\python\python37\lib\runpy.py", line 193, in run_module_as_main
"main", mod_spec)
File "c:\users\manan\appdata\local\programs\python\python37\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "C:\Users\manan\AppData\Local\Programs\Python\Python37\Scripts\mpv-remote-app.exe_main
.py", line 9, in
File "c:\users\manan\appdata\local\programs\python\python37\lib\site-packages\mpv_remote_app_init
.py", line 85, in main
set_root(args)
File "c:\users\manan\appdata\local\programs\python\python37\lib\site-packages\mpv_remote_app_init_.py", line 49, in set_root
args.root = abspath(realpath((args.root)))
File "c:\users\manan\appdata\local\programs\python\python37\lib\ntpath.py", line 526, in abspath
return normpath(_getfullpathname(path))
TypeError: _getfullpathname: path should be string, bytes or os.PathLike, not NoneType
PS C:\Users\manan>

server dies on long lists

There's a directory with a couple thousands of files. When entering here via clent, server dies:

INFO:root:Received command: "{'time': 1623258978499, 'directory': './curl/ftp_shares/volb/v', 'command': 'list'}"
Traceback (most recent call last):
  File "/home/bfg/.local/bin/mpv-remote-app", line 8, in <module>
    sys.exit(main())
  File "/home/bfg/.local/lib/python3.8/site-packages/mpv_remote_app/__init__.py", line 99, in main
    ms.run(daemon=args.daemon)
  File "/home/bfg/.local/lib/python3.8/site-packages/mpv_remote_app/media_server.py", line 53, in run
    self._serve(self._recv())
  File "/home/bfg/.local/lib/python3.8/site-packages/mpv_remote_app/media_server.py", line 207, in _serve
    if ack: self._ack(ret, msg)
  File "/home/bfg/.local/lib/python3.8/site-packages/mpv_remote_app/media_server.py", line 127, in _ack
    self.sock.sendto(response, self.client)
OSError: [Errno 90] Message too long

keep multiple controllers in sync

It would be nice to have any controllers connected to the server stay in sync when one changes state.

This requires:

  • adding a listener on the controller
  • the server remembering who its clients are

It will require a lot of work and at this point is low priority.

audio settings

add setting in menu to choose which audio track to use

Cryptographic APIs misuses

I'm a PhD student interested in finding security vulnerabilities in open source projects.

We found a total of 04 warnings (indicating potential vulnerabilities) when running the CogniCrypt static analyzer (*) on mpv-remote-app(or its library dependencies). We documented each one of these issues in private gists for the sake of confidentiality (non-disclosure).

Can you please let us know whether we can share these gists with you? We are eager to evaluate the perception of developers (e.g. severity of these warnings) and improve mpv-remote-app's security, and the quality of the reports of static analysis tools.

(*) https://github.com/CROSSINGTUD/CryptoAnalysis

package name and directory discrepancy

This is mostly semantic and does not affect compilation but the directory structure uses miccah.laptopremote but source java files, and the manifest uses miccah.mpvremote in their package name declarations. This makes some symbols in the editor appear as unresolved, or be displayed with a full path i.e. miccah.mpvremote.Settings.

For example:
https://github.com/mcastorina/mpv-remote-app/blob/master/MpvRemote/app/src/main/java/miccah/laptopremote/MainActivity.java#L1

exit / stop playback from app

Add an X or square (stop) button to "quit" mpv. This will send the stop command which will stop playback and close the video, but the player will remain in an idle state (ready for a loadfile)

app doesn't display files

If server starts own mpv instance, even with using '-r path/to/media', hitting library in app results in nothing. I can see the server is "browsing" the path, but app doesn't display anything. So no control possible :-(

In app feedback

Provide a way to give feedback in the application. (No popups!)

Easily control / kill server when daemonized

The --daemon flag works and will fork a new process, however to kill the server requires sending a kill signal to that PID.

The way to do this is not very user friendly, so I need to consider writing another application to communicate with the server when it is a daemon.

how to run the server

i have installed this app on my phone and computer and the next step says run the server, but i am a bit confussed as to how, is it a programm or a command line?

Quality-of-life app improvements

Hey,

it would be great if the app could remember the last host, port and password used when it's opened. Also, being able to use a hostname (not just an IP address) would be very convenient, I think. Lastly, the keyboard isn't auto-closed when you leave the menu, which overlaps the player controls.

Thanks a lot!

possibly insecure code

this section of server.py is prone to attacks

            # Authenticate
            if auth(data, server_password) == False:
                if json.loads(data["message"])["command"] != "health":
                    continue

a malicious user could exploit the json interpreter after the auth fails

a better approach would be to have the health command be a raw request instead of wrapped in an HMAC (e.g. health instead of {'time': ...., 'message': '{"command": "health"}'} )

this way, we can check if the string data == "health" before we authenticate

Continuous seek

Currently seek is implemented by repeating a small seek command (e.g. seek 5). This makes the playback jumpy and is especially noticeable in the audio.

It would be a better experience to have smoother seek functionality.

How to run tests

Hi @mcastorina, I'm having a hard time running the server tests... Here's the output that I get. Am I missing some configuration?

$ make test
python3 -m unittest discover tests
E
======================================================================
ERROR: setUpClass (test_media_server.TestMediaServer)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/marcomarra/git/mpv-remote-app/server/tests/test_media_server.py", line 18, in setUpClass
    cls.server.run(daemon=True)
  File "/home/marcomarra/git/mpv-remote-app/server/mpv_remote_app/media_server.py", line 47, in run
    self.open()
  File "/home/marcomarra/git/mpv-remote-app/server/mpv_remote_app/media_server.py", line 42, in open
    self.sock.bind((self.address, self.port))
socket.gaierror: [Errno -2] Name or service not known

Server doesn't find running mpv instance

Checked out, pip install requirements, start mpv as stated in Readme, but server.py doesn't recognize the running instance and starts its own. So no control of running instance possible

If server starts own mpv instance, even with using '-r path/to/media', hitting library in app results in nothing. I can see the server is "browsing" the path, but app doesn't display anything. So no control possible :-(

Wrong video played via shared data

Related to feature #58

Oftentimes, the wrong yt video is played when a link is shared from another app. This seems to occur when the video code contains non alphanumerical characters.

Moreover, #58 enforces parsing a URL using ytdl:// protocol, which is restrictive, since videos can be streamed from multiple sources, not just yt. Therefore, playing a video from URL should be made general, without assuming yt to be the source.

How to can play from mpv-android?

I was using peerflix and follow the instructions step by step but when i want to click on the button play appear a message failed.

Configuration mpv remote

IP Address: localhost 
Port: 88888
Password: p4ssw0rd

Android app resets settings on orientation change

Settings panel resets settings on phone orientation change.
mpv-remote version 0.0.3, Android 11.

Steps to reproduce:

  1. Have Auto-rotate screen android setting on;
  2. Open sliding panel with Settings and fill in any field;
  3. Rotate phone.

Expected behaviour: settings are saved.
Actual behaviour: settings are reset to defaults.

standardize messaging protocol

currently I am simply passing whitelisted commands straight to the IPC server, but it would be a good idea to use a standard messaging protocol

either document the messaging protocol or adhere to a current standard

fastforward / rewind faster

make the speed of FF / RW be a function of time the button is held (i.e. the longer you hold the button, the faster it goes)

F-Droid build failed

FAILURE: Build failed with an exception.

* What went wrong:
Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the User Manual chapter on the daemon at https://docs.gradle.org/7.5.1/userguide/gradle_daemon.html
Process command line: /usr/lib/jvm/java-8-openjdk-amd64/bin/java --add-exports=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED -Xmx2048M -Dfile.encoding=UTF-8 -Duser.country=GB -Duser.language=en -Duser.variant -cp /opt/gradle/versions/7.5.1/lib/gradle-launcher-7.5.1.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 7.5.1
Please read the following process output to find out more:
-----------------------
Unrecognized option: --add-exports=java.base/sun.nio.ch=ALL-UNNAMED
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.


* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Could you please take a look? Thanks!

Mute button

Add mute button next to volume slider

[X] ---------o------

Cache library hierarchy

Currently each directory change in the library will ask the server for the files. Caching this data will give better performance and user experience.

More buttons :)

Hello,

I just made this work and it's working surprisingly well so far. Thanks for making this!

There are a couple of buttons I would like to request, which are useful:

  • Info (which briefly shows OSD with progress, timers, etc.)
  • Next/Previous chapter
  • Next/Previous playlist item
  • A-V delay +/- (next to audio track button?)
  • Sub delay +/- (next to sub track button?)
  • video-zoom maybe?

Thanks a lot!

PS: Maybe it's even a good idea to directly proxy mpv's ipc json format (with auth, and blacklist (for e.g. run command) added on top of course), instead of translating all commands on software? This way the Android software just needs to send the correct JSON, with no modifications to the server needed to add new commands.

Poorly Instance Indentification

I set the following into ~/.config/mpv/mpv.conf:

input-ipc-server=/tmp/mpvsocket

This is equivalent to starting mpv with the --input-ipc-server=/tmp/mpvsocket cmd argument, but the server script doesn't indentify as such, and start a new instance.

If this is solved, i think it's possible to set up the server as a script to start along with mpv in a very transparent way.

Forking question

Would you mind it if I fork your project but rewrite it completely?
I want to possibly ditch the Python sever and extend/modernize the user interface a lot?
Otherwise I'd use the project as inspiration and write my own from scratch.

Asking this here, because there's no other way to reach you.

Fresh build fails due to bad make recipe

Invoking make build after a fresh clone fails with the following error:

python3 -m build
/usr/bin/python3: No module named build
make: *** [Makefile:13: dist] Error 1

The reason seems to be in the dist dependency of the make recipe of build:

dist: setup.py $(PY_FILES)
$(PYTHON) -m build

dist recipe should probably be something like:

$(PYTHON) setup.py sdist bdist_wheel

So the dist recipe should be fixed, if it serves a different purpose than build.

Playlist

Add a playlist feature to queue videos

Surplus of resource files in the distribution

I've noticed there are several irrelevant/unutilized resources like:
side_nav_bar.xml,
all ic_menu_*.xml
file.xml,
folder.xml
activity_main_draw.xml

Also, in my opinion, SettingsAdapter.java should be re-coded as it's very inflexible if one wishes to add new views to the sidebar or set custom properties to them.

Can't play files with non-ASCII filenames?

It seems that non-ASCII filenames cause some trouble to the server - example debug output:

DEBUG:root:Received: "{"message":"{\"time\":1555279337058,\"command\":\"play\",\"path\":\".\\\/ττ.mkv\"}","hmac":"b66d4189c5170c1b274e8115f7622edb"}"
INFO:root:Authentication failed for command: "{'message': '{"time":1555279337058,"command":"play","path":".\\/ττ.mkv"}', 'hmac': 'b66d4189c5170c1b274e8115f7622edb'}"

Can't browse non-ASCII directories, either:

INFO:root:Received command: "{'time': 1555279609126, 'directory': '.', 'command': 'list'}"
DEBUG:root:Sending ACK: "{"action": 1555279609126, "time": 1555279598434, "result": true, "message": {"directories": ["\u03c4\u03b5\u03c3\u03c4", "test"], "files": []}}"
DEBUG:root:heartbeat
DEBUG:root:Received: "{"message":"{\"time\":1555279609962,\"directory\":\".\\\/τεστ\",\"command\":\"list\"}","hmac":"dba7c18b31dbcae8fb505d98acd1b15a"}"
INFO:root:Authentication failed for command: "{'message': '{"time":1555279609962,"directory":".\\/τεστ","command":"list"}', 'hmac': 'dba7c18b31dbcae8fb505d98acd1b15a'}"

Running with Python 3.7.3 under Gentoo Linux.
Thanks!

add custom url feature

use the app to start streaming content from a website (e.g. youtube)

I think a good place to start is to allow custom urls so the user can browse youtube, then copy and paste the link into the mpv remote app

use logging library

instead of directly printing (using print), use the logging library and include --verbose flags

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.