-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Http request properties #4361
Comments
I believe one possibility would be to use the OkHttp extension. When creating the OkHttpClient to be passed to the OkHttpDataSourceFactory constructor, install an Interceptor. From within the Interceptor, you should be able to read the request header fields. |
All media sources -I guess you are interested in DASH- allow you to inject a DataSourceFactory. You can provide your own DataSource implementation which intercepts all requests. Please let me know if this does not cover your needs. Have a look at the DefaultDashChunkSource. |
Also, maybe @tonihei can provide better advise. |
You'll get some request details as a listener callback when you add an However, I suppose you refer to the HTTP request headers and/or response headers? These are not currently part of the callback, but we can add them to |
Thanks for your help. I will explore this and really looking forward for the enhancement. To clarify @tonihei doubt of what I'm looking for: http://cdn.dashjs.org/latest/jsdoc/streaming_vo_metrics_HTTPRequest.js.html |
Thanks. I think we already have all of the information in this class available and just need to add the response headers. |
Both values are helpful for event reporting, but are only available while the data source is open. Similar to bytesLoaded, they need to be reported through the Chunk. Issue:#2054 Issue:#4361 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=201664907
@tonihei , as you said the members of the following class http://cdn.dashjs.org/latest/jsdoc/streaming_vo_metrics_HTTPRequest.js.html are already available in exoplayer library. Is it possible to extract these information in one of the event listener methods I checked the dataspec object returned from loadEventInfo, it doesn't really return the information tht I'm looking for.(trace, trequest, tresponse, tfinish). However I managed to find media duration, bytes loaded and source uri 👍 Could you suggest a way to get the following information: |
"Time at which request is sent" - that corresponds to the |
Thanks @tonihei for your suggestion. Seems like I have my solution here. However, I have small clarification on Transfer listener. I'm already using Moreover I could not override the |
Good point. It's currently not possible to have multiple transfer listeners. However, we already changed the code to allow multiple transfer listeners per data source in the future. Will be in one of the next releases. |
@tonihei Thanks for the clarification. 👍 Regarding your suggested solution, I could able to get the information that I needed but the issue that I'm facing right now is that, I have to collect these metrics periodically when the load is completed and send it to metric server, since I'm listening to multiple event methods ( My approach was, I created a class for HTTPList with the attributes as the details that I'm looking for and I write the data to object of this class during the execution of these event methods. Is there a better way of implementation to overcome this issue. I'm sure having a class like this http://cdn.dashjs.org/latest/jsdoc/streaming_vo_metrics_HTTPRequest.js.html in library would be of great help in future. But for now, any suggestion from your perspective would be helpful. Moreover, the media duration for the bytes that is transferred, is it possible to get it as well? |
I don't understand where the problem is with getting the callbacks immediately? Note that the TransferListener callbacks are called on the loading thread and AnalyticsListener callbacks on the main thread. Maybe that's the reason why you think there not called in sequential manner. The media duration is often only known after the load finished. Please listen to updates in onTimelineChanged to check whether the duration is available. |
The response headers of the last load are available from the loading source when creating media source events and can be easily forwarded. Issue:#4361 Issue:#4615 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=209900693
Closing the issue. The response headers are now part of the LoadEventInfo data. |
Im working on a project to collect the metrics of the exoplayer. For my metrics, I'm looking forward to extract the http request properties(http list in dash.js) when the player request for fragments. Is there any possible way in the current api to get what I am looking for?
The text was updated successfully, but these errors were encountered: