cguZZman / plugin.googledrive

The Google Drive addon for Kodi
GNU General Public License v3.0
212 stars 72 forks source link

Playback stops abruptly #222

Open Navios92 opened 3 years ago

Navios92 commented 3 years ago

I've been having this weird problem when playing my library strm files. If I pause the movie and leave it paused for a while, and then try to resume again, the playback stops abruptly after a couple of seconds. This also happens when I don't pause the movie at all but try to rewind after leaving it playing for several minutes without pausing.

Here is a log file. I played a movie for a couple of minutes - skipped back a little - left it playing for about 9 minutes and then paused - left it paused for a while and when I resumed, it played for a couple of seconds and then stopped.

cguZZman commented 3 years ago

Even though your log does not show any helpful information, I will try to reproduce it. I see a possible reason for the issue: the API change made last year. It will be only a confirmation anyway. If the api change is the reason, there will be no fast solution.

Navios92 commented 3 years ago

Thanks for looking into it. Let me know if you need more logs.

cguZZman commented 3 years ago

I just made the test a moment ago, and confirmed the issue. At the end, it is because of the API change.

The stop happens because the credentials or token given by the google servers are only good for 1 hour, max. And as long as the addon has the control for navigation and play, a current credential is always available. The problem is that as soon as the playback starts, the addon has no way to update the credential. Kodi will be streaming the file and, after some time, if the credential has expired and you try to seek, this will cause the playback to stop since google will reject the request. This was solved before by creating a download service within the addon that first will refresh the credentials if needed and then redirect the request to google. But because of the API change, this redirect is not possible anymore.

For now, there is no other thing to do than play your file again. It will work because as soon as the playback stops, the addon will have the control and will update the credentials. So the file will play just fine.

I will leave this issue open, but there are no ETA for the fix as this will require a major change (building a proxy) and will require a lot of time.

your0nlyfan commented 3 years ago

I'm experiencing this way back last year during -ber months. If my phone os is in android 10 or 11. Problem arises but if i put android 9 on my phone and use kodi, playback is normal Even on my mibox with kodi build which uses android 9 has a nice playback. Though on my windows 10 pc, problem is there

cguZZman commented 3 years ago

to keep this thread clean, unrelated issues were deleted. @hmp22 if the issue is or looks different, open a new one.

tonyleerep commented 2 years ago

2months now since I have updated the 19.2/3 versions, the google drive videos keep stop playing. I tried to load the gdrive video from another file app and open from there with kodi player and it played fine. Must be something with the new kodi version or gdrive addon. PS. I have a Sony android smart tv

Cyber5imon commented 2 years ago

I just ran into this issue. When pausing a video for some length of time... Resuming the video will play the remaining buffered stream and then stop playing.

One workaround is to increase the buffer size large enough to contain the entire file. This allows the download to complete regardless of pausing.

Is it possible for the plugin to trap the error that the stream has been interrupted, refresh the auth token, then resume the download/stream at the last resume point? I hope I'm not taking out of my a$$.