-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Standalone offline Storage (no Player, no video) #1297
Comments
It's possible. If I recall, we have previously gotten requests to break Shaka Player into multiple modules that can be optionally loaded depending on a user's needs. This could be part of a larger effort like that. On a smaller scale, it might be easier to make it so that you can make a |
Starting with not having to associate a player with storage would be good. |
I misread the function. I was thinking it was part of the loading process, not the storing process. No, you're right, it'd be possible to call |
So in general the only issue I see is the coupling to the |
From config, it uses |
The reason we use a Player instance in Storage is to share the configuration and networking engine. We wanted to avoid requiring the app to configure both the Player and the Storage with their retry parameters, restrictions, and request filters. We could have Storage use its own networking engine, but the app will need to register its request/response filters with Storage in addition to the Player. But we could add a convenience method to copy the settings from the given Player so the app doesn't need to copy everything. As for the configuration, maybe we should move the Storage-specific settings into a sub-section. Like |
I mentioned the use case above.
From my experience with clients they require to download without a playback
use case.
Think of this in terms of Netflix experinave.
You open the app and see the gallery of movie titles, no playback is
required.
User than starts downloading straight from that screen.
This is the more popular use case and for this a player is not required
yet, or at all.
Once background fetch is implemented not requiring a player would be even
more common.
So the share logic might not be relevant in this case.
WDYT?
…On Tue, 20 Feb 2018 at 19:38 Jacob Trimble ***@***.***> wrote:
The reason we use a Player instance in Storage is to share the
configuration and networking engine. We wanted to avoid requiring the app
to configure both the Player and the Storage with their retry parameters,
restrictions, and request filters. We could have Storage use its own
networking engine, but the app will need to register its request/response
filters with Storage in addition to the Player. But we could add a
convenience method to copy the settings from the given Player so the app
doesn't need to copy everything.
As for the configuration, maybe we should move the Storage-specific
settings into a sub-section. Like streaming, we could have a storage
group. Then the Storage.configure method would accept the same thing as
Player. The downside is that it will be complicated to implement with
reverse-compatibility.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1297 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFNXZpbP6mmVtmcHoH5P-TuhNbxLeUVnks5tWwL7gaJpZM4SCnww>
.
|
I am making plans to remove the requirement that
We could go further and allow If we did all of that, we could still have an optional link to a |
Could the client app instantiate a |
Good idea. I'll let @vaage have the final say, though, as he is already deep in the implementation. |
@chrisfillmore Thank you for the suggestion - I will add that to my list of possible solutions to explore. Right now the greatest challenge we are facing with this issue is how to maintain backward-compatibility while not inhibiting the new designs. |
As part of the effort to allow storage to be initialized with or without a player instance, this change moves the offline config into the player config and changes storage to share a configuration object with a player instance. We opted to share the instance between the two classes because if storage was initialized with player, the initializer is implying a relationship between the two objects and therefore configuration changes should be shared. Issue #1297 Change-Id: I991365255e63c284fbfcf147cf63c9588dd764ab
Allow users to get access to the networking engine that storage instances are using. This is part of allowing storage to be used without a player instance as it will allow users to configure the networking engine when they create a storage instance without a player instance. The code still assumes that Storage should never destroy the networking engine. This is something that will need to change when storage can be initialized without player. Issue #1297 Change-Id: If8d1642259e0cf24cb43f2ca7936227e8d939260
There was a cast in Storage.deleteAll that really should not have been there. This changes it to use an assert to ensure that the case is exposed if done wrong. Issue #1297 Change-Id: I21f9737c0fc79c2b4324a7385a2814f94f40f884
We store the references to player's networking engine and configuration in Storage, so there is no reason to call player anymore. This change removes those lingering calls. Issue #1297 Change-Id: I3486ffcb60cd80fd765259d690091cc3267bb8ba
This changes Storage to use the destroyer object to manage clean-up. This will later be used to change how we destroy storage depending on how it was initialized. Issue #1297 Change-Id: I7e8c4f959a6764859504b0259bd5e815e5fd3dc8
I see that the only thing required by the offline class from the player instance is
getConfiguration
andgetNetworkingEngine
.The
getNetworkingEngine
in the player class gets a callback for on segment downloadhttps://github.com/google/shaka-player/blob/35d8838ed38ea798cb3b63065d1ce05e364b3bab/lib/player.js#L805-L807
But it is not used in offline mode as there's no ABR(right? I don't see anyone calling
player.load
which initialises the abrManager_ member):https://github.com/google/shaka-player/blob/35d8838ed38ea798cb3b63065d1ce05e364b3bab/lib/player.js#L2422-L2427
So it actually can be exposed and used directly, no?
I'm asking this as I'm trying to understand how can I relate to the following use case:
Usually for offline an app will showcase a gallery window where potentially no player is initialised in it yet.
The user will see a mosaic of videos and might want to download from this screen.
If I follow the Shaka offline guide I see that a player instance needs to be created, and I would like to avoid this.
To add to this - an app might want to create the logic of a queue manager and download simultaneously a few entries and for this it would have to initialise a couple of players, each one with it's own video tag.
So my question - is there any necessity for the player instance to be passed to the offline class?
Maybe I'm oversimplifying things and there are other considerations you took into account.
Maybe creating the offline as a separate component will yield a smaller lib that takes care of download, that as I mentioned above, can happen without any player being loaded, then this can help an app load less code for as it would only have to load the offline download library for just downloading.
The offline requires mainly classes from the offline directory and utils.
The two main classes it requires from the player is the ManifestParser and DrmEngine, both requiring the NetworkingEngine, which is also required by the offline(as mentioned in the start here above).
In addition there's the configuration management but this can also be separated to its own class and then used by the offline class directly.
I think this can lead to major decrease in size of the offline and create an offline manager which can be used in tandem with the player but serve the purpose of actual offline download use case.
WDYT?
Thanks,
Oren M.
The text was updated successfully, but these errors were encountered: