Mobile Redirect Video to External App

Detects video sources by injecting code to bypass player sandboxing and uses robust redirect methods.

作者
MasuRiii
日安装量
1
总安装量
2
评分
0 0 0
版本
4.7
创建于
2025-10-21
更新于
2025-10-21
大小
15.2 KB
许可证
MIT
适用于
所有网站

Tired of being stuck in clunky, ad-filled web players on your phone? This script is for Android users who want to watch web videos in their favorite, feature-rich media player app like MX Player, VLC, or MPV.

It intelligently detects video sources on almost any website, even on complex, sandboxed players (like JWPlayer) that other scripts can't access. It then creates a simple button that uses the Android Intent system to pass the video link directly to your chosen external app.

✨ Key Features

  • Universal Detection: Finds video sources from standard <video> tags and modern JavaScript players by safely injecting code to intercept the source URL.
  • Android Intent Integration: Creates a special intent:// link that tells your Android system to open the video in a media player, not another browser tab.
  • Robust Redirection: The latest version uses a CSP-safe redirection method, ensuring it works even on websites with strict security policies that block other redirect scripts.
  • Multi-Video Support: If a page has multiple video sources, it presents a clean pop-up modal for you to choose the correct one.
  • Highly Configurable: Easily edit the script to always open a specific app (e.g., MX Player Pro) or to show the standard Android app chooser every time.
  • Built-in Debugger: Includes a simple "Inspector" tool that helps you (and the author!) troubleshoot sites where the script might not work automatically.

⚙️ How to Use

  1. Install the script on a mobile browser that supports userscripts (e.g., Kiwi Browser, Firefox with Violentmonkey).
  2. Navigate to a webpage with a video.
  3. Wait a few seconds for the script to detect the video source.
  4. A button labeled "Open Externally" will appear at the bottom-center of your screen.
  5. Tap the button.
    • If one video was found, your phone will either open it directly in your preferred app or show the Android app chooser (based on your configuration).
    • If multiple videos were found, a pop-up will appear listing all available links. Tap the one you want to open.

🔧 How to Configure the Script

You can customize the script's behavior by editing it in your userscript manager.

  1. Go to your Tampermonkey/Violentmonkey Dashboard.
  2. Find "Mobile Redirect Video to External App" and click the Edit icon.
  3. Look for the CONFIGURATION section at the top of the script.
const CONFIG = {
    INTENT_TYPE: 'CHOOSER', // 'CHOOSER' or 'SPECIFIC_APP'
    SPECIFIC_APP_PACKAGE: 'com.mxtech.videoplayer.pro',
    BUTTON_TEXT: 'Open Externally',
    DEBUG_MODE: true,
    DEBUG_INSPECTOR: true
};

Configuration Options:

  • INTENT_TYPE: This is the most important setting.

    • 'CHOOSER': (Default) Tapping the button will always bring up the Android system's "Open with..." dialog, letting you choose which video app to use each time.
    • 'SPECIFIC_APP': Tapping the button will attempt to open the video directly in the app defined by SPECIFIC_APP_PACKAGE.
  • SPECIFIC_APP_PACKAGE: The package name of the app you want to use when INTENT_TYPE is set to 'SPECIFIC_APP'. Here are some common examples:

    • MX Player Pro: 'com.mxtech.videoplayer.pro'
    • MX Player (Free): 'com.mxtech.videoplayer.ad'
    • VLC for Android: 'org.videolan.vlc'
    • mpv-android: 'is.xyz.mpv'
    • (You can find the package name of any app by using an "App Inspector" app from the Play Store.)
  • BUTTON_TEXT: Change the text that appears on the redirect button.

  • DEBUG_MODE and DEBUG_INSPECTOR: Keep these true to help with troubleshooting.

After making changes, save the script.

🐞 Troubleshooting / It's Not Working!

Some websites use very unusual video players. If the "Open Externally" button doesn't appear, you can help me add support for that site by using the built-in inspector.

  1. A small bug icon (🐞) will be visible in the bottom-right corner of the screen. Tap it.
  2. The page will enter "Inspector Mode." Your cursor will become a crosshair.
  3. Tap directly on or as close as you can to the video player on the page.
  4. This will not do anything visually, but it will print a detailed report in your browser's Developer Tools Console.
  5. How to view the console on a mobile browser:
    • Kiwi Browser: Tap the three-dot menu -> "Developer tools".
    • Firefox: Requires remote debugging from a computer.
  6. Go to the "Console" tab, copy the entire report (it starts with "--- [Video Redirector] Inspector Report ---"), and **create a new post in the Feedback section of this script. Paste the report there.