Comments (5)
Currently, selectPlaylist()
is called every time a chunk finishes downloading. The size of the chunk is not exposed but it is possible to determine the amount of time it took to download it and the estimated bitrate of the network connection based on the download time. What are you thinking of doing with the chunk size and timing info?
from videojs-contrib-hls.
@dmlap Thanks.
I require the start and end of the download time of each chunk to calculate metrics based on the video playback.
How is it that I could determine the start time of the download? Also, is it possible to listen for the start and end of the download, or would I have to fork the project and add my own code into the selectPlaylist()
function?
from videojs-contrib-hls.
The total download time is exposed as player.hls.segmentXhrTime
after each chunk is downloaded. I'll update the README so that's clearer. If you need an absolute start time for the download, you should be able to subtract that value from Date.now()
to get it.
selectPlaylist()
is a public part of the API so you don't need to fork the repo to modify it. I would save a reference to the default implementation and override it with a function that calculates your metrics and then delegates back to the original. Patching over selectPlaylist()
does seem a little weird for what you're trying to achieve and we may end up adding a first-class event for segment downloads if this turns out to be common. The override solution would still work if we end up going that direction, though.
from videojs-contrib-hls.
Thank you for the information, that should be what I need.
I'm assuming the loadedmetadata
event has information associated with it such as the target duration of the chunks?
from videojs-contrib-hls.
Glad to hear that worked!
The loadedmetadata
event itself doesn't carry much information but you can look on the HLS tech when it fires to see how the playlist was parsed. The media() method on the playlists object always contains the most up-to-date info on the active playlist, including the target and segment durations.
from videojs-contrib-hls.
Related Issues (20)
- Autoplay freeze and seek pixalate HOT 2
- Problem with load balancer HOT 2
- Videoplayer sometimes falsely returns ERROR: (CODE:4 MEDIA_ERR_SRC_NOT_SUPPORTED) HOT 1
- Android Chrome: overrideNative has no effect HOT 4
- When m3u8 one of the signals has an error. HOT 1
- External links cannot be played in https websites HOT 2
- How to play ts video directly HOT 1
- s
- Incorrect Zoom for videojs player on Chrome HOT 3
- VideoJS HLS player starts playing Live stream after skipping some fragments HOT 2
- How to switch audio group or audio quality to auto or other in hls? HOT 3
- Add deprecation warning to website
- Subtitles showing wrong
- How to switch audio quality (for ex.. stereo/surround)? HOT 4
- HLS will not respond to IE11 browser for a period of time using 'videojs-contrib-hls' HOT 1
- a long m3u8 video problem HOT 2
- long time m3u8 video cannot play with chrome
- request m3u8 and get ts successfully, but can not play, also no errors HOT 2
- Failed to remove source buffer from media source error when disposing player HOT 1
- Videojs-contrib-hls still fetching the stream when video player has paused HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from videojs-contrib-hls.