moneytoo / Player

▶ Simple and lightweight, yet polished and powerful Android video player based on ExoPlayer
https://play.google.com/store/apps/details?id=com.brouken.player
The Unlicense
1.57k stars 182 forks source link

Запоминание время для продолжения воспроизведения видео #470

Closed efr07 closed 1 year ago

efr07 commented 1 year ago

Можно ли реализовать запоминание время для продолжения воспроизведения видео. Что если не досмотрел фильм, заново не делать перемотку на место где остановился. Заранее спасибо

moneytoo commented 1 year ago

This should generally work, as long as videos are identified by unique, but stable content provider uris (for example when accessing local files) or urls (when streaming files directly). If you are using some app that allows access to some content by proxying it using varying url then this may not work.

efr07 commented 1 year ago

This should generally work, as long as videos are identified by unique, but stable content provider uris (for example when accessing local files) or urls (when streaming files directly). If you are using some app that allows access to some content by proxying it using varying url then this may not work.

Я смотрю через TorrServe

moneytoo commented 1 year ago

Trying out Torrserve MatriX.122.5.F-Droid, it works for me and position restores. The used uri seems stable, for example something like:

http://127.0.0.1:8090/stream/ABC.S01E01.XYZ.mkv?link=6666666666666666666666666666666666666666&index=1&play

So if you have issues, describe exact steps to replicate it.

Alexxlexx2020 commented 1 year ago

this problem can be solved if you remember not the whole path but only the file name in order to continue from the exit point. please do it)

Alexxlexx2020 commented 1 year ago

i am playning from torrserve too, but he is external, for example 192.168.0.12:8090. position restore don't work(. use only file name, not path name for restore play point, please)

moneytoo commented 1 year ago

this problem can be solved if you remember not the whole path but only the file name in order to continue from the exit point. please do it)

That wouldn't work with structure like that (as it's something I saw myself in the past):

/folderA/video.mkv
/folderB/video.mkv
Alexxlexx2020 commented 1 year ago

yes, I understand, but you can set a point in the settings to enable or disable the file path, that's how it's done in Vimu player (sory for my bad english)

crapapult commented 1 year ago

So if you have issues, describe exact steps to replicate it.

I can confirm that this functionality is somewhat broken. My steps to reproduce this problem:

Torrserve Matrix.122 + Just Player 0.142

  1. Add torrent file to torrserve.
  2. Open the file from torrserve with Just Player. Video starts playing.
  3. Fast-Forward 10min as example. Video starts playing.
  4. Click back on the remote to exit JustPlayer.
  5. Open torrserve and click on the same exact file to open it.
  6. Just player starts the video from the beginning.

I've checked URI from torrserve and it doesn't change while using the same torrent file. It's like http://192.168.1.48:8090/stream/Video.mkv?link=xxxxxxxxxxxxxxxxxxxxxx&index=1&play Deleting video file(torrent) from torrserve and re-adding it doesn't change the URI, so I guess torrserve is not the issue.

But I remembered that playback resume with torrserve was working when I was using older builds of JustPlayer and so I've checked. And yes, it works on the exact same setup with JustPlayer 0.95(and bellow) and maybe a few versions up(didn't had time to check every build) but from 0.104 it's broken.

moneytoo commented 1 year ago

Just Player doesn't remember position (among other things like subtitle and audio tracks) when it detects it was launched from other app that passes additional parameters using the MX Player API (like position related options, title and subtitle track options). Because when apps do that, it's a sign that they can (as they usually do) control the position by themselves.

TorrServe passes title so remembering is disabled because of that. Now I'm not quite sure if I included that because of compatibility with some streaming clients (like Jellyfin or Emby) or not. But I guess I can try changing that and see if any other issue arrises. Try a version from https://brouken.com/player/ Does it work now?

crapapult commented 1 year ago

Try a version from https://brouken.com/player/ Does it work now?

Thank you! Yes, now it works and restores video at the correct timestamp. One observation that it doesn't start playback after loading the stream from restored timestamp and you need to press play button to start video. Idk if this is the correct behavior but I get the logic of it, so maybe it's not an issue.

Alexxlexx2020 commented 1 year ago

all is work!!! restore play point in torrent. well done. great thanks!!!

moneytoo commented 1 year ago

One observation that it doesn't start playback after loading the stream from restored timestamp and you need to press play button to start video.

This should work in the latest release.