Android app to extract video (file/stream) URLs from websites and watch them elsewhere (internal/external video player, Google Chromecast, ExoAirPlayer).
BrowserActivity
is shown when the app is started, and includes:- a very basic web browser
- address bar
WebView
- actionbar icons:
- bookmark toggle
- add/remove current website URL to/from list of persistently saved Bookmarks
- bookmark toggle
- actionbar menu items:
- Bookmarks
- open drawer on left: Bookmarks
- Videos
- open drawer on right: Videos
- Settings
- open
SettingsActivity
- open
- Exit
- close all UI and exit the app
- Bookmarks
- drawer on left: Bookmarks
- contains a persistent list of:
- website URLs that have been saved via the bookmark toggle icon
- video URLs that have been saved via the Videos drawer
- click a list item to:
- open website URL in WebView
- watch video URL
SettingsActivity
determines the particular action to be performed
- long click a list item to:
- rename
- delete
- contains a persistent list of:
- drawer on right: Videos
- contains a transient list of video URLs that have been found on the web page that is currently loaded in the
WebView
- this list is cleared each time the
WebView
navigates to a new web page
- this list is cleared each time the
- click a list item to:
- add video URL to list of persistently saved Bookmarks
- watch video URL
SettingsActivity
determines the particular action to be performed
- long click a list item to:
- delete
- contains a transient list of video URLs that have been found on the web page that is currently loaded in the
- a very basic web browser
SettingsActivity
is started from the actionbar menu inBrowserActivity
, and includes:- Video Player to select whether to watch videos using..
- internal w/ Chromecast sender
- start
VideoActivity
- start
- external
- start Activity chooser w/ an implicit Intent
- action
android.intent.action.VIEW
- data
- video URL
- type
- mime-type for format of video
- extras
referUrl
- (String) referer URL
- used by ExoAirPlayer
- action
- start Activity chooser w/ an implicit Intent
- ExoAirPlayer sender
- start
ExoAirPlayerSenderActivity
- start
- HLS-Proxy configuration
- start Activity chooser w/ an implicit Intent
- action
android.intent.action.VIEW
- data
http://webcast-reloaded.surge.sh/proxy.html#/watch/${base64_video}/referer/${base64_referer}
- type
- "text/html"
- action
- start
HlsProxyConfigurationActivity
- only when there is no Activity having a matching Intent filter
- which should never happen, since any standard web browser should offer to handle this Intent
- only when there is no Activity having a matching Intent filter
- start Activity chooser w/ an implicit Intent
- internal w/ Chromecast sender
- Video Player to select whether to watch videos using..
VideoActivity
is started when a video URL is watched using the internal video player, and includes:- ExoPlayer
- displays an icon in lower right corner of video controls toolbar to toggle fullscreen mode on/off
- Chromecast sender
- displays an actionbar cast icon when at least one Google Chromecast is detected on LAN
- when connected to a Chromecast
- video URLs are communicated to the receiver app running in the Chromecast
- the Chromecast receiver app loads the video URL in an embedded HTML5 video player
- transfer of video data occurs directly between the Chromecast and the server that hosts the video URL
- transfer would not be effected by any of the following events:
VideoActivity
stoppedBrowserActivity
stopped- WebCast app exited
- Android device powered off
- list of video URLs
- click a list item to:
- play video URL
- if connected to a Chromecast:
- on Chromecast
- otherwise:
- on Android, in ExoPlayer
- all HTTP requests include the referer url
- on Android, in ExoPlayer
- if connected to a Chromecast:
- play video URL
- click a list item to:
- ExoPlayer
ExoAirPlayerSenderActivity
is started when a video URL is watched using the ExoAirPlayer sender, and includes:WebView
that loads a single web page- URL of the web page depends on version of Android
- Android 5.0 and newer
- Android 4.x and older
- URL hash contains:
#/watch/${base64_video}/referer/${base64_referer}
- URL of the web page depends on version of Android
- web page reads data from URL hash and pre-populates fields:
- video url
- referer url
- web page reads data from cookies and pre-populates fields:
- host
- port
- https
- provides a basic UI to control any ExoAirPlayer receiver app that is reachable through the network
HlsProxyConfigurationActivity
is started when a video URL is watched using HLS-Proxy configuration on a device without any available web browser, and includes:WebView
that loads an ES5 compliant web page- URL hash contains:
#/watch/${base64_video}/referer/${base64_referer}
- URL hash contains:
- web page reads data from URL hash and pre-populates fields:
- video url
- referer url
- web page reads data from cookies and pre-populates fields:
- host
- port
- https
- clicking the Load Player button performs the following tasks:
- configures a new video URL that redirects the HLS manifest through HLS-Proxy
- redirects
WebView
to another ES5 compliant web page that provides optional endpoint destinations for the proxied HLS manifest- ES6 web page for ExoAirPlayer sender
- ES5 web page for Chromecast sender
- in
WebView
on Android 4.x and older:- video player functionality does not work
- in
WebView
on Android 5.0 and newer:- video player functionality works
- Chromecast sender functionality does not work
- in
-
some video URLs may play in WebCast and ExoAirPlayer, but cannot play on Chromecast or other external video players
- this can occur when a video URL is hosted by a server that uses the
Referer
HTTP request header to restrict access, which is a common strategy- WebCast and ExoAirPlayer have the functionality to configure the value of this header for each unique video URL
- Chromecast receiver apps cannot change the value of this header because they are restrained by standard browser security policies
- the specs for XHR and fetch forbid changing certain HTTP request headers, including
Referer
- the WebCast Chromecast receiver app
- the specs for XHR and fetch forbid changing certain HTTP request headers, including
- other external video players would need to:
- read the
referUrl
extra in the starting Intent - configure its HTTP client library to change the value of this header
- read the
- HLS-Proxy provides a convenient general-purpose workaround
- setup for integration with WebCast:
- usage:
- run HLS-Proxy
hlsd --port 8080 --req-insecure --useragent "Chrome/90"
- in WebCast
- navigate internal
WebView
to a page having the desired HLS video stream - open the Videos drawer (on right)
- click on the URL for the desired HLS video stream
- click: Watch
- an Activity chooser will start
- WebMonkey will be included in the list of apps that contain a matching Activity
- click: WebMonkey
- navigate internal
- in WebMonkey
- in WebCast
- run HLS-Proxy
- this can occur when a video URL is hosted by a server that uses the
-
the Android System
WebView
component is wholly responsible for the web browser experience- this component has a complicated history
- without going into detail:
- on versions of Android < 5.0
- the
WebView
component is baked into the firmware- cannot be updated
- does a poor job loading modern webpages, as the javascript language (ES6+) and html spec (HTML5) have changed significantly
- the
- on versions of Android >= 5.0
- the
WebView
component is a standalone application- can be updated
- the
- on versions of Android >= 7.0
- the
WebView
component is superseded by a component of the Google Chrome web browser, when it is installed and enabled- can be updated
- the
- on versions of Android < 5.0
- stale branches
- 01-foundation
- collection of small apps to develop and test experimental features
- 02-webcast-httpclient
- used an external HTTP client library: Apache HttpClient
- used the
Content-Type
response header to detect video files
- 03-webcast-okhttp
- used an external HTTP client library: okhttp
- used the
Content-Type
response header to detect video files
- 04-webcast-filename
- uses
WebView
to download all HTTP requests - uses regular expressions to detect file extensions associated with video formats in URL requests
- uses
- 01-foundation
- active branches
- 05-webcast-filename-media3
- uses
WebView
to download all HTTP requests - uses regular expressions to detect file extensions associated with video formats in URL requests
- builds upon the 04-webcast-filename branch, and migrates from ExoPlayer to AndroidX Media3
- uses
- 00-chromecast-receiver-app
- WebCast Chromecast receiver app
- gh-pages
- WebCast Chromecast receiver app
- the HEAD of this branch should always reference/alias the HEAD of the 00-chromecast-receiver-app branch
- hosted by GitHub Pages
- WebCast Chromecast receiver app
- 05-webcast-filename-media3
- identification of video URLs in outbound HTTP requests
- same methodology as implemented by a web browser extension
- copyright: Warren Bank
- license: GPL-2.0