Seneral / FlagPlayer

Music-oriented YouTube web-app - single-page, client-side, simple
https://flagplayer.seneral.dev
16 stars 5 forks source link

Automatically cache audio when playing #8

Open NeuroCPP opened 2 years ago

NeuroCPP commented 2 years ago

@Seneral I don't know about the languages and scripts that were used in this project But I am quite familiar with them... I want to ask if there is any way to ##Automatically Cache the playing content As it seems that the Cache First functions just as preloading the content I hope you understand and help me out or guide me to the way, so that I can do it on my own

Your Junior NeuroCPP image SOME GUYS THAT I KNOW AS WELL: @p3g4asus

Seneral commented 2 years ago

Oh that is a good feature to add, yes. Unfortunately it is impossible (afaik) to cache what is currently playing, but you can either a) wait for it to cache before playing when it's not cached yet b) play it and cache it simultaneously, as soon as caching has surpassed the play head it should use the cached content automatically, though I did not test it.

How to do these things: Call ct_cacheVideo (or make a new function using db_cacheStream that does not create notifications) in ct_mediaLoaded before md_updateStreams, if you want a) you can do a .then/.catch (JS Promise) between them to chain them (only works when you do db_cacheStream manually, unfortunately ct_cacheVideo doesn't expose the promise interface yet)

NeuroCPP commented 2 years ago

Thank you for your reply And that's what I am talking about...if it is possible can you create a you know..like inspiration or to be done type thingy...so that anyone from github can contribute to it...i will have some of my engineers to help work on it if possible By Junior NeuroCPP

On Wed 15 Dec, 2021, 4:36 PM Seneral, @.***> wrote:

Oh that is a good feature to add, yes. Unfortunately it is impossible (afaik) to cache what is currently playing, but you can either a) wait for it to cache before playing when it's not cached yet b) play it and cache it simultaneously, as soon as it has

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Seneral/FlagPlayer/issues/8#issuecomment-994682350, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUP66TN4LCACPGFWYJLZC3TURBZDNANCNFSM5KC32NHQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

Seneral commented 2 years ago

Oh sure, just updated my comment, accidentally clicked close (on mobile) before finishing it. Hope that gives you an idea. If you want, feel free to create a pull request whne you're done, good feature to have (could add a toggle in settings as well)

Seneral commented 2 years ago

oh btw, "Cache First" is misleading that toggle is supposed to switch between it using the cache and using the online version when it has internet (e.g. always use cache vs checking for updated audio). Now that I think about it, almost no reason to disable it, audio won't change usually, so we could switch that to be "Cache Automatically"

NeuroCPP commented 2 years ago

good opinion to be pointed out... my opinion is to first add the description of the "cache first" .. so that someone who reads it never misunderstands it..... As for pointing it out..... I loved your work....

NeuroCPP commented 2 years ago

And to be said I want to that if we can KEEP the cache first and automatically having different toggle buttons... Wait for sometime ... I will upload a video recording or audio recording to explain.. In the meanwhile I will try to learn some JC and HTML so that i can also help you out

NeuroCPP commented 2 years ago

[FOR NEWCOMERS]Refer to #13 if you want to