Giter Site home page Giter Site logo

warren-bank / android-webcast Goto Github PK

View Code? Open in Web Editor NEW
91.0 10.0 16.0 2.36 MB

Android app to extract video (file/stream) URLs from websites and watch them elsewhere (internal/external video player, Google Chromecast, ExoAirPlayer).

License: GNU General Public License v2.0

Java 100.00%

android-webcast's Introduction

Android app to extract video (file/stream) URLs from websites and watch them elsewhere (internal/external video player, Google Chromecast, ExoAirPlayer).

Screenshots..

WebCast WebCast WebCast WebCast WebCast WebCast WebCast WebCast WebCast WebCast WebCast WebCast WebCast WebCast WebCast WebCast WebCast WebCast


Tour

  • 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
    • actionbar menu items:
      • Bookmarks
        • open drawer on left: Bookmarks
      • Videos
        • open drawer on right: Videos
      • Settings
        • open SettingsActivity
      • Exit
        • close all UI and exit the app
    • 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
    • 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
      • 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
  • SettingsActivity is started from the actionbar menu in BrowserActivity, and includes:
    • Video Player to select whether to watch videos using..
      • internal w/ Chromecast sender
        • start VideoActivity
      • external
        • start Activity chooser w/ an implicit Intent
          • action
            • android.intent.action.VIEW
          • data
            • video URL
          • type
            • mime-type for format of video
          • extras
      • ExoAirPlayer sender
        • start ExoAirPlayerSenderActivity
      • 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"
        • 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
  • 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 stopped
            • BrowserActivity 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
  • ExoAirPlayerSenderActivity is started when a video URL is watched using the ExoAirPlayer sender, and includes:
    • WebView that loads a single web page
    • 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}
    • 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

Important Caveats

  • 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
          • attempts to change the value of this header
          • reveals in the remote debugger console that this attempt raises the warning:
            • Refused to set unsafe header "referer"
      • 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
      • HLS-Proxy provides a convenient general-purpose workaround
        • setup for integration with WebCast:
          1. install HLS-Proxy
            • npm install --global "@warren-bank/hls-proxy"
          2. install WebMonkey
          3. in WebMonkey
            • install WebCast-Reloaded userscript
              • adds enhanced functionality to the ES5 compliant web page that provides HLS-Proxy configuration
                • enables a button labeled: Start App
                • when clicked:
                  • start Activity chooser w/ an implicit Intent
                    • action
                      • android.intent.action.VIEW
                    • data
                      • proxied HLS manifest URL
                    • type
                      • "application/x-mpegurl"
          4. in WebCast
            • Settings > Video Player > HLS-Proxy configuration
        • usage:
          1. run HLS-Proxy
            • hlsd --port 8080 --req-insecure --useragent "Chrome/90"
          2. 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
          3. in WebMonkey
            • configure the location of your running instance of HLS-Proxy:
              • host
              • port
              • https
            • click: Start App
              • an Activity chooser will start
              • WebCast will be included in the list of apps that contain a matching Activity
              • click: WebCast Video Player
          4. in WebCast
            • click the Chromecast sender icon Chromecast sender icon to cast the proxied HLS video stream to a Chromecast device
  • 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
      • on versions of Android >= 5.0
      • 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

Organization of Git Repo

Highlights of Source Code


Legal

android-webcast's People

Contributors

warren-bank avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

android-webcast's Issues

Share activity

This app should have share options in the share menu.

special problem

Hi brother, I have a problem that I can't find a script that sends the link of the video I'm playing in a browser to ListView to convert it to a video stream.

App will force close when trying to load complex websites in an outdated WebView.

Expected behavior

The users should be able to visit web pages without getting any trouble.

Actual behavior

When I visited and tried to open a post, then the app crashed. https://steemit.com was the website.

How to reproduce

  1. Open the app
  2. Go to https://steemit.com
  3. Try to open a post by clicking on it. A few seconds later notice the bug.
  • App version: 04.07.01
  • Operating system: Android 6.0.1

LogCat

All the logs that I produced on my phone.

05-21 16:13:49.996  2697  3586 I WindowState: WIN DEATH: Window{787efe1 u0 d0 p17267 com.github.warren_bank.webcast/com.github.warren_bank.webcast.webview.BrowserActivity}

05-21 16:13:49.996  2697  2712 D ConnectivityService: ConnectivityService NetworkRequestInfo binderDied(NetworkRequest [ id=95, legacyType=-1, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED] ], android.os.BinderProxy@dfcb6c2)

05-21 16:13:49.996  2697  2711 I ActivityManager: Process com.github.warren_bank.webcast (pid 17267)(adj 1) has died(93,304)

05-21 16:13:49.996  2697  3093 D ConnectivityService: releasing NetworkRequest NetworkRequest [ id=95, legacyType=-1, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED] ]

05-21 16:13:49.996  2697  2711 D ActivityManager: cleanUpApplicationRecord -- 17267

05-21 16:13:49.996  2697  3093 D ConnectivityService: sending notification RELEASED for NetworkRequest [ id=95, legacyType=-1, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED] ]

05-21 16:13:49.996  2697  3590 D ConnectivityService: ConnectivityService NetworkRequestInfo binderDied(NetworkRequest [ id=96, legacyType=-1, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED] ], android.os.BinderProxy@551cd3)

05-21 16:13:50.006  2697  2711 D ActivityManager: removeProcessNameLocked mProcessNames.remove pid=17267 ,hash=25155352 ,name=com.github.warren_bank.webcast

05-21 16:13:50.006  2697  2711 D ActivityManager: isAutoRunBlockedApp:: com.github.warren_bank.webcast, Auto Run ON

Asked assistant

Peace be upon you, brother. I want you to create a library that converts indirect links into direct links, because I want to make an application to watch anime, and I really need this feature.

I hope you reply me quickly

On Android 6, the default homepage is `null` instead of "about:blank". Clicking the `bookmark` toggle icon causes app to crash.

Expected behavior

I expected that the app would warn or block me when I tried to bookmark a blank page.

Actual behavior

The app crashed when I bookmarked a blank page. After that this crash occurring every time whenever I am trying to open the app.

How to reproduce

Here is every possible detail to reproduce the bug.

  1. Open the app
  2. Click on the bookmark button at the top of your screen.
  3. Notice the crash. After that, whenever you will try to open this app, you have to face the crash. (You can make it workable again after deleting the app data)
  • App version: 04.07.01
  • Operating system: Android 6.0.1

Recording Of The Bug

bug

LogCat

05-21 14:35:14.108  8984  8984 E AndroidRuntime: FATAL EXCEPTION: main

05-21 14:35:14.108  8984  8984 E AndroidRuntime: Process: com.github.warren_bank.webcast, PID: 8984

05-21 14:35:14.108  8984  8984 E AndroidRuntime: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.equals(java.lang.Object)' on a null object reference

05-21 14:35:14.108  8984  8984 E AndroidRuntime: 	at com.github.warren_bank.webcast.webview.BrowserActivity$DrawerListItem.equal(Unknown Source)

05-21 14:35:14.108  8984  8984 E AndroidRuntime: 	at com.github.warren_bank.webcast.webview.BrowserActivity$DrawerListItem.find(Unknown Source)

05-21 14:35:14.108  8984  8984 E AndroidRuntime: 	at com.github.warren_bank.webcast.webview.BrowserActivity$DrawerListItem.contains(Unknown Source)

05-21 14:35:14.108  8984  8984 E AndroidRuntime: 	at com.github.warren_bank.webcast.webview.BrowserActivity.onCreateOptionsMenu(Unknown Source)

05-21 14:35:14.108  8984  8984 E AndroidRuntime: 	at android.app.Activity.onCreatePanelMenu(Activity.java:3142)

05-21 14:35:14.108  8984  8984 E AndroidRuntime: 	at androidx.f.a.e.onCreatePanelMenu(Unknown Source)

05-21 14:35:14.108  8984  8984 E AndroidRuntime: 	at androidx.appcompat.view.i.onCreatePanelMenu(Unknown Source)

05-21 14:35:14.108  8984  8984 E AndroidRuntime: 	at androidx.appcompat.app.g$d.onCreatePanelMenu(Unknown Source)

05-21 14:35:14.108  8984  8984 E AndroidRuntime: 	at androidx.appcompat.view.i.onCreatePanelMenu(Unknown Source)

05-21 14:35:14.108  8984  8984 E AndroidRuntime: 	at androidx.appcompat.app.j.i(Unknown Source)

05-21 14:35:14.108  8984  8984 E AndroidRuntime: 	at androidx.appcompat.app.j$1.run(Unknown Source)

05-21 14:35:14.108  8984  8984 E AndroidRuntime: 	at android.os.Handler.handleCallback(Handler.java:739)

05-21 14:35:14.108  8984  8984 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:95)

05-21 14:35:14.108  8984  8984 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:148)

05-21 14:35:14.108  8984  8984 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:7325)

05-21 14:35:14.108  8984  8984 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)

05-21 14:35:14.108  8984  8984 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)

05-21 14:35:14.108  8984  8984 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)

player

Any way to open the player without having to wait for the whole process to load the page?

externally viewing to download the video

ill ask the question here so the app catches the link i pressed the view with external player then i picked the download manager and it worked fine now the problem is when i manually take the link from the videos tab and put it in download manager it doesnt work is it like a token type of link
can we chat on discord pls m1ke#5850

Unable to cast YouTube videos

I am able to cast the videos on my TV from abcNews very well. But it does not work for any of the YouTube videos.
In fact when the YouTube videos are searched they don't list on the left side drawer in the same manner as abcVideos did?

See how the left drawer contains the video listing available on abcnews site

Screenshot_2021-03-10-14-25-39-296_com github warren_bank webcast

However in case of YouTube the video listing section is completely empty

Screenshot_2021-03-10-14-29-07-726_com github warren_bank webcast

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.