polimediaupv / paella-core

Paella Player core library
Educational Community License v2.0
20 stars 15 forks source link

Paella starting different videos always at the last point in time #367

Closed gasparuben closed 2 months ago

gasparuben commented 2 months ago

hi, We are running paella core 1.41.0 and plugins version 1.23.0.

Recently we have noticed that paella keeps a preference cookie where the last playing point in time, I think it's called, "lastKnownTime" is kept. The problem we have noticed is that this point in time is not only applied to the the actual playing video but any other video you try to play afterwards, which we think it shouldn't be the behavior. It may be better to store that lastKnownTime per video e.g. keep a track of the last 5 videos, so one avoids to play new videos from the point in time, left on the previous one.

E,g. https://lecturemedia.cern.ch/2023/1212689c60/ & https://lecturemedia.cern.ch/2024/1426767/, please see attached pictures.

Thank you, Ruben Capture02 Capture01

karendolan commented 2 months ago

Hi @gasparuben, our site is using the latest paella-core 1.49.3 and our lastKnownTime setting is per mediapackageId.

This commit shows that that setting is saved in the non-global space, at least in the latest version of paella-core.

        const lastKnownTime = await this.player.preferences.get("lastKnownTime", { global: false });

https://github.com/polimediaupv/paella-core/commit/5d42d60d84275923940603a8c2f9df1ed98f161a

ferserc1 commented 2 months ago

Indeed, as @karendolan says, the last known time instant is stored associated with the video identifier. However, it is possible to completely disable this feature in the settings.(videoContainer.restoreLastTime):

https://paellaplayer.upv.es/#/doc/configuration.md

I have not been able to reproduce the problem you mention, but it is important to note that there are ways of using the paella-core API where this bug can occur. The default method paella-core uses to uniquely identify the current stream is to use the id parameter in the URL. If you are using another method to identify a video, you need to properly implement the function that informs paella-core of that identifier, or else it will not be able to associate a video stream with its preferences:

https://paellaplayer.upv.es/#/doc/initialization.md

In particular, in the initialisation parameters you have to make sure that the getVideoId function is properly implemented: it is not enough to implement getManifestUrl to get the video data, and it may be that the problem comes from here.