WATERMeDIA: Multimedia API

WATERMeDIA: Multimedia API

551k Downloads

[NetworkAPI] Overhaul entrypoints

SrRapero720 opened this issue ยท 1 comments

commented

OVERVIEW

Current UrlAPI and NetworkAPI sucks.
The most important change is have an URL-like class containing the whole set of variables (source string, URL, attached fixers and url type). Catching the URLs is neccesary to avoid had to re-fix the URL (in case urls needs to be "Refixed" everytime can be done just "reloading it".

Network request should be done using java 8 openConnection in a wrapper class just to have better control of the InputStream and the gson coversion

This also will add support for some custom protocols for local files (Addressing all kind of special support on modders/devs side)

PROTOCOLS
here is the list of the added protocols to let users have access to their local files

  • local:///<path/to/file.mp4> - the current RUNTIME path file
  • game:///<path/to/file.mp4> - the game path file (result might be same as local)
  • users;//<pc_user>/<path/to/file.mp4> - specific user path
  • user:///<path/to/file.mp4> - current user path
  • tmp:///<path/to/file.mp4> - temp file path.

Task to acomplish this

  • Remove third-party dependencies (only rely on gson)
  • NetFetch (wrapper of URLConnection) and NetUrl
    • NetURL: data about Url Type (local, stream, fixed, fixed date)
    • NetURL: catching
  • Mark NetworkAPI as a Unsafe API: it will throw exceptions if fails
  • Make models of every fixer page (json to java object)
  • module fixers
  • Add mature entrypoint (different over "Special fixer")
commented

Updated protocols

  • water://local.wm/<path/to/file.mp4> - the current RUNTIME path file as root
  • water;//user.wm/<video/path/to/file.mp4> - Active user video path as root
  • water://tmp.wm/<path/to/file.mp4> - TMP path as root.

Discarted

  • users;//<pc_user>/<path/to/file.mp4>: No reason to exists
  • game:///<path/to/file.mp4>: duplicate of local