I would like to be able to replace the XMLHttpRequest object for player requests. Many other players allow for such a mechanism (examples as follows):
Microsofts AMP player has an xmlHttpRequestFactory
VideoJS allows for overwriting their xhr instance in the beforeRequest hander
Shaka NetworkingEngine#registerScheme allows for doing the same based on scheme.
The goal is to allow for custom request tracking and alternative content delivery mechanisms. Currently Viblast supports modifying parameters that get passed to the xhr object via XHR manipulation. However, the exposed functions only allow for modification of the xhr object, but do now allow for overwriting of the object. To provide alternative content delivery (much like your own PDN) is not possible as the xhr instance cannot be replace or provided via an alternate implementation.
It is possible to do this by overwriting the window's XMLHttpRequest, but I'd rather only modify the requests generated from the player, rather than all requests created by the browser.
At the moment the XMLHttpRequest can not be replaced via the player API. As you mentioned, it is possible to replace it via the global API and this is the only way to achieve the goal. You can get information about the requests performed by Viblast Player via XHR manipulation API and perhaps to filter them.
Is there any intention or plan to alter the behavior by providing something like the above description?
We don't have plans to add API for XHR replacement in the near future.
Ok. Thanks for the feedback.