4

I am writing a custom receiver for chromecast and was wondering if there is a way we can have our own, custom XHR loader functionality rather then the built in goog.net.XhrIo?

Basically I need to override the functionality of goog.net.XhrIo for all segments/fragments and media files.

I need this to send some beacons back to my servers for analytics.

Thanks!

Brad
  • 159,648
  • 54
  • 349
  • 530
Corehacker
  • 267
  • 1
  • 2
  • 7

1 Answers1

2

If you are using the Media Player Library (MPL), then you can use skipRequest() and setResponse() to achieve what you want to do. Note that the Host class provides a number of overrides for updating Segments, Manifest, License and Captions request info.

Ali Naddaf
  • 16,951
  • 2
  • 21
  • 28
  • @Corehacker: please add the ticket you wanted to reference in a separate comment (or in your original post) since that is not part of my original response, I think it would be better to not include that as part of my response. – Ali Naddaf Dec 13 '16 at 00:23
  • No issues. Here is the forum post which has more details and reference URLs: https://code.google.com/p/google-cast-sdk/issues/detail?id=1026 – Corehacker Dec 13 '16 at 20:08
  • @AliNaddaf Do you by chance have an up-to-date version of this answer? It seems the APIs you referred to before no longer exist. (Or, am I looking in the wrong places?) – Brad Nov 20 '20 at 04:49