Giter Site home page Giter Site logo

Comments (4)

mangui avatar mangui commented on August 19, 2024

Hi @stiller-leser
not clear, it is up to you to only P2P-load fragment and keep using a regular XHR for playlist loading in your custom loader ?

from hls.js.

stiller-leser avatar stiller-leser commented on August 19, 2024

Hey @mangui,

Thanks for the fast reaction. Sorry I'll try to be more specific. Yes it is up to me. I want to download the playlist for one peer (peer1) and have him load the fragments the traditional way and cache them in his SessionStorage? (not sure where yet). Now if another peer (peer2) connects later on, he would download the playlist and ask peer1, if he could download the fragment from him instead of the server - which is why I only would need to modify the fragment loader.

I am in kind of a R&D phase (thinking about different ways to realize such a peer2peer-approach for my bachelor thesis), so it might change. Also I am aware that this would only work effectively if peer2 connects later - after peer1 has downloaded the fragment. A P2P-connection with the server (in my case via webRTC) would be unrealistic with many peers (bandwidth and performance wise).

Thanks for your support!
stiller-leser

from hls.js.

mangui avatar mangui commented on August 19, 2024

yes, this is what I understood, good luck for your project.
you can easily detect URL type (fragment vs playlist) and use utils/xhr-loader for playlist loading, and your own P2P / WebSocket loader for fragment loading.

from hls.js.

stiller-leser avatar stiller-leser commented on August 19, 2024

Hey,
excuse me for reopening the topic. I hope you don't mind.

By now I found out, that if the load function was called from the PlaylistLoader the responseType would be a String with a length of 0. In the case of the FragmentLoader it would be a String with a length of 11 and the content 'arraybuffer'. This of course enables me to use a simple if statement.

However, as I understand, if I pass the loader into the config, it replaces the standard loader for both the PlaylistLoader and the FragmentLoader. My approach would now be, to create a new XhrLoader in the "Playlist" case and call its load function, just passing on the arguments and use my own load function in the "Fragment" case. Did I understand the principle correctly?

What do you think of a refactoring, that would allow targeted replacement of the PlaylistLoader or the FragmentLoader (via two config options)?

Thanks and sorry again for reopening,
stiller-leser

from hls.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.