Giter Club home page Giter Club logo

fx_cast's Introduction

Preview of cast device selection popup

fx_cast

Firefox extension that implements the Chrome sender API and exposes it to web apps to enable cast support.

Communication with receiver devices is handled by a native application (bridge). Check the implementation notes for more info.

No full public release yet! Pre-release beta version is incomplete and likely buggy.

Installing

Supported platforms

  • Linux
  • macOS
  • Windows

Install the Firefox extension and companion bridge application. Downloads can be found on the website or in the GitHub releases section.

macOS/Windows version has an installer, Linux packages can be installed via the command line:

# Debian/Ubuntu
sudo dpkg -i fx_cast_bridge-<version>-<arch>.deb

# Fedora
sudo dnf install fx_cast_bridge-<version>-<arch>.rpm

Package managers

Building

Requirements

  • dpkg (for building deb packages)
  • rpm (for building rpm packages)
  • macOS (for building macOS installer packages)

Installing dependencies

macOS:

brew install dpkg rpm makensis

Debian/Ubuntu:

sudo apt install dpkg rpm nsis

Fedora:

sudo dnf install dpkg rpm-build mingw-nsis

Archlinux:

sudo pacman -S nvm dpkg
yay -S rpm-org nsis

# Downgrade to node10
echo 'source /usr/share/nvm/init-nvm.sh' >> ~/.bashrc
nvm install 10.12.0

Instructions

git clone https://github.com/hensm/fx_cast.git
cd fx_cast
npm install
npm run build
npm run install-manifest

This will build the ext and app, outputting to dist/:

  • dist/app/

    ... contains the bridge binary and manifest with the path pointing that binary. install-manifest copies this manifest to the proper location (or adds its current location to the registry).
  • dist/ext/

    ... contains the unpacked extension.

Watching ext changes:

npm run watch --prefix ./ext

Launch Firefox and auto-reload on rebuild (run in separate terminal):

npm run start --prefix ./ext

Packaging

macOS packages can only be created on macOS, Linux .deb/.rpm packages can be built on any platform with dpkg-deb and rpmbuild binaries, and Windows installers can be created on any platform with the makensis binary.

  • dist/app/

    ... contains the installer package: fx_cast_bridge-<version>-<arch>.(pkg|deb|rpm|exe)
  • dist/ext/

    ... contains the built extension in the format fx_cast-<version>.zip.

Build and package app and extension for current platform:

npm run package

Packaging examples:

# Linux platforms
npm run package --prefix ./app -- --platform=linux --packageType=deb
npm run package --prefix ./app -- --platform=linux --packageType=rpm

# Windows
npm run package --prefix ./app -- --platform=win32

# macOS
npm run package --prefix ./app -- --platform=darwin
Package script arguments
  • --platform "win32","darwin","linux"
    Select the platform to build for. Defaults to current platform.
  • --arch "x64","x86"
    Select platform arch to build for. Defaults to current platform arch.
  • --packageType "deb","rpm"
    Select the package type. Defaults to deb. Only relevant when building for Linux.

Testing

Testing requires geckodriver (or chromedriver for Chrome parity testing). See selenium-webdriver installation instructions (ignore npm install).

Test results will be displayed within the opened browser tab.

npm run build --prefix ./app
npm run install-manifest
npm run package --prefix ./ext
npm test
SELENIUM_BROWSER=chrome npm test

Usage

Extension can be loaded from about:debugging as a temporary extension.

Most sites won't load the cast API unless the browser presents itself as Chrome. The extension includes a method of spoofing the user agent string, sites can be whitelisted via the options page. Whitelist entries are specified as match patterns. To whitelist all sites, add <all_urls> to the whitelist, though this could cause breakage on random sites.

HTML5 media elements have a "Cast..." context menu item that triggers a sender application. Only works on remote (non-local) media that isn't DRM-encumbered.

Cast-enabled websites will load the sender API shim and display a cast button as in Chrome, provided there are no bugs/incompatibilities with the shim.

Video Demos

Netflix / HTML5:

fx_cast Netflix fx_cast HTML5

Credit

Note: Since it seems to be causing confusion, this project does not use electron. The electron-chromecast library was only used as a reference for the initial implementation of the API shim.

Donation

PayPal

To donate via PayPal:

Donate with PayPal button

Donate with PayPal

fx_cast's People

Contributors

hensm avatar ravmn avatar benjamin-dobell avatar csicar avatar edwardbetts avatar vistaus avatar

Watchers

James Cloos avatar

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.