Giter VIP home page Giter VIP logo

webtorrent-desktop's Introduction


WebTorrent
WebTorrent Desktop

The streaming torrent app. For Mac, Windows, and Linux.

discord travis github release version github release downloads Standard - JavaScript Style Guide

Install

Recommended Install

Download the latest version of WebTorrent Desktop from the official website:

Advanced Install

  • Download specific installer files from the GitHub releases page.

  • Use Homebrew-Cask to install from the command line:

    $ brew install --cask webtorrent
    
  • Try the (unstable) development version by cloning the Git repository. See the "How to Contribute" instructions.

Screenshots

screenshot screenshot

How to Contribute

Get the code

$ git clone https://github.com/webtorrent/webtorrent-desktop.git
$ cd webtorrent-desktop
$ npm install

Run the app

$ npm start

Watch the code

Restart the app automatically every time code changes. Useful during development.

$ npm run watch

Run linters

$ npm test

Run integration tests

$ npm run test-integration

The integration tests use Spectron and Tape. They click through the app, taking screenshots and comparing each one to a reference. Why screenshots?

  • Ad-hoc checking makes the tests a lot more work to write
  • Even diffing the whole HTML is not as thorough as screenshot diffing. For example, it wouldn't catch an bug where hitting ESC from a video doesn't correctly restore window size.
  • Chrome's own integration tests use screenshot diffing iirc
  • Small UI changes will break a few tests, but the fix is as easy as deleting the offending screenshots and running the tests, which will recreate them with the new look.
  • The resulting Github PR will then show, pixel by pixel, the exact UI changes that were made! See https://github.com/blog/817-behold-image-view-modes

For MacOS, you'll need a Retina screen for the integration tests to pass. Your screen should have the same resolution as a 2018 MacBook Pro 13".

For Windows, you'll need Windows 10 with a 1366x768 screen.

When running integration tests, keep the mouse on the edge of the screen and don't touch the mouse or keyboard while the tests are running.

Package the app

Builds app binaries for Mac, Linux, and Windows.

$ npm run package

To build for one platform:

$ npm run package -- [platform] [options]

Where [platform] is darwin, linux, win32, or all (default).

The following optional arguments are available:

  • --sign - Sign the application (Mac, Windows)
  • --package=[type] - Package single output type.
    • deb - Debian package
    • rpm - RedHat package
    • zip - Linux zip file
    • dmg - Mac disk image
    • exe - Windows installer
    • portable - Windows portable app
    • all - All platforms (default)

Note: Even with the --package option, the auto-update files (.nupkg for Windows, -darwin.zip for Mac) will always be produced.

Windows build notes

The Windows app can be packaged from any platform.

Note: Windows code signing only works from Windows, for now.

Note: To package the Windows app from non-Windows platforms, Wine and Mono need to be installed. For example on Mac, first install XQuartz, then run:

$ brew install wine mono

(Requires the Homebrew package manager.)

Mac build notes

The Mac app can only be packaged from macOS.

Linux build notes

The Linux app can be packaged from any platform.

If packaging from Mac, install system dependencies with Homebrew by running:

npm run install-system-deps

Recommended readings to start working in the app

Electron (Framework to make native apps for Windows, OSX and Linux in Javascript): https://electronjs.org/docs/tutorial/quick-start

React.js (Framework to work with Frontend UI): https://reactjs.org/docs/getting-started.html

Material UI (React components that implement Google's Material Design.): https://material-ui.com/getting-started/installation

Privacy

WebTorrent Desktop collects some basic usage stats to help us make the app better. For example, we track how well the play button works. How often does it succeed? Time out? Show a missing codec error?

The app never sends any personally identifying information, nor does it track which torrents you add.

License

MIT. Copyright (c) WebTorrent, LLC.

webtorrent-desktop's People

Contributors

akaustav avatar alxhotel avatar bluemancz avatar bnjmnt4n avatar borewit avatar cezar-carneiro avatar clujin avatar codealchemist avatar dcposch avatar dependabot[bot] avatar diegorbaquero avatar dsernst avatar feross avatar flet avatar furstenheim avatar goldob avatar greenkeeper[bot] avatar greenkeeperio-bot avatar grunjol avatar hicom150 avatar karanjthakkar avatar mathiasvr avatar michaelgeorgeattard avatar noamokman avatar recox avatar renovate-bot avatar renovate[bot] avatar rom1504 avatar surajrathod avatar ungoldman 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

webtorrent-desktop's Issues

Add webtorrent:// protocol handler

Moved into it's own issue from #54 (comment)...

Since torrent streaming isn't supported by most popular torrent managers; developers and websites could make an integration for this without requiring users to rethink their default torrent configurations.

Websites that share torrent files generally have links such as 'Download Torrent' and 'Open Magnet'. Imagine an extra link saying 'Stream Torrent'. That's what I'd like to see.

Bonus suggestion: decide on a general torrent streaming protocol (i.e. str://<magnet>) with https://github.com/jaruba/PowderPlayer so that developers can simply add 'Stream Torrent` links that support any torrent app with the protocol!

Package for Debian

Hi, a Debian package for webtorrent-app would be nice. I've tried creating one with fpm; running fpm -s npm -t deb inside the directory does not create a working Debian package (no binary to run from /usr/local/bin).

Batch virtual-dom changes

We don't want to calculate the virtual DOM multiple times in the same animation tick. That's wasted CPU cycles.

That said, it's hard to guarantee that update() won't be called multiple times in one tick. So, update() needs to get smarter.

Set WebTorrent as the default handler for .torrent files and magnet links

Let's add a button to the Preferences Pane #62 for enabling this for magnet links. Like with lots of other things, I think Transmission gets this UI and wording right:

screen shot 2016-03-07 at 6 24 27 pm

For .torrent files, I think we just register with the OS that our application can open .torrent files and leave it up to the OS and user to configure WebTorrent as their default.

Tasks

  • OS X: Handle .torrent files
  • OS X: Handle magnet links
  • Windows: Handle .torrent files
  • Windows: Handle magnet links
  • Linux: Handle .torrent files
  • Linux: Handle magnet links

Preferences Window

After these issues have been opened: #5, #50, #53. Maybe we should consider putting these features into preferences pane?

Scroll bar goes under header bar

On OS X, scroll bars will show up when you plug in a mouse. When that happens it's easy to see that the scrollbar starts under the header.

This didn't used to be a problem so it probably slipped in during one of the other CSS changes.

screen shot 2016-03-08 at 6 03 30 pm

Error processing argument at index 0 conversion failure from at TypeError (native) at toggleFullScreen (Linux)

In Linux (Fedora 23 x64) when I click on the full screen menu

Error processing argument at index 0 conversion failure from at TypeError (native) at toggleFullScreen (Linux)

appears the popup with following error:

Uncaught Exception:
TypeError: Error processing argument at index 0, conversion failure from 
    at TypeError (native)
    at toggleFullScreen (/home/joseluis/webtorrent-app/main/menu.js:30:18)
    at MenuItem.click (/home/joseluis/webtorrent-app/node_modules/electron-prebuilt/dist/resources/atom.asar/browser/api/lib/menu-item.js:69:18)
    at Function.delegate.executeCommand (/home/joseluis/webtorrent-app/node_modules/electron-prebuilt/dist/resources/atom.asar/browser/api/lib/menu.js:128:69)

Add support for magnetURIs

Some trackers make super easy to obtain magnet links compared to download the .torrent's.

Adding support for them would be very useful. (:

Simplify speed/size numbers in the UI

We want to be the simplest torrent client! 😄

No one cares if they're getting 850.62 KB/s or 850.91 KB/s as their download speed.

Let's round with Math.floor() in pretty-bytes, like we already do for the progress percentage.

screen shot 2016-03-06 at 1 16 34 am

downloads folder

Right now downloads just go to /tmp/webtorrent and get deleted on restart. This app needs a persistent downloads folder!

1. default

What is standard the downloads folder for each OS? For OS X it's ~/Downloads. Might be good to set default to whatever the OS default is.

2. custom

We need a way to set a custom downloads folder location. Perhaps this is the beginning of a preferences view.

Releasing builds for linux/mac/windows

Is it easy to build for several platform and put it in a github release ?

Anyway I think it can be important ,once the app is ready, for people that don't want to install node.js (themselves). Especially on windows(/mac).

Startup speed

  • Measure init time (#234)
    • Measure require() time, find out which dependencies are loading slowly
    • Get init time under 200ms (from icon click to rendered page)
  • Speed up torrent initialization
    • Use torrent files, not magnet links, for the default Blender Foundation videos
    • Once an infohash has been loaded from the DHT, cache or save it
  • Reduce waste (#238)
    • Stop virtualdom from swapping out every event handler on every tick

move player to separate window

I think it would be beneficial to move the video player to a separate window so that a user can see everything in the list and have one or more video players open simultaneously. This would simplify managing state for the list window too.

If you think it's worth doing, I can take a crack at it.

Controls hide whilst scrubbing

The playback controls will hide after two seconds while the user is scrubbing. This is because dispatch('videoMouseMoved') is not being called within handleScrub()

`ConnectDataChannel called when data_channel_ is NULL`

% rm -rf ~/.config/WebTorrent
% git rev-parse HEAD
4085dd1062a704dc95cd12dbdfa0915eb40e6d56
% npm build; npm start

> [email protected] start /home/crusty/webtorrent-app
> electron .

loaded state from /home/crusty/.config/WebTorrent/config.json
[1808:0308/095229:ERROR:webrtcsession.cc(1384)] ConnectDataChannel called when data_channel_ is NULL.
[1808:0308/095229:ERROR:webrtcsession.cc(1384)] ConnectDataChannel called when data_channel_ is NULL.
[1808:0308/095229:ERROR:webrtcsession.cc(1384)] ConnectDataChannel called when data_channel_ is NULL.
[1808:0308/095229:ERROR:webrtcsession.cc(1384)] ConnectDataChannel called when data_channel_ is NULL.

As seen above, when pressing the play red button lots of error are logged.

Sure I could send everything to /dev/null, but...

Can you reproduce it on other platform?

+ button should show prompt

Make the + button on the header bar show a prompt for a torrent id string (magnet link, http/fs path to .torrent, etc.).

Video is looping automatically

The video should just stop when it's finished, not restart again. Not sure how this is happening since there's no loop attribute added to the video tag like <video loop>.

Very strange.

AirPlay scrubber does not sync between desktop and Apple TV

I have not tested this on a Chromecast, but I suspect this issue may also apply there.

Currently, if you're streaming a torrent within the WebTorrent desktop app and then click on the AirPlay icon, the video will restart playing on desktop while simultaneously streaming to your Apple TV. This is different behaviour to what is typically seen when a user is browsing the Web and decides to AirPlay an HTML5 video.

Expected behaviour:

  • The user clicks the AirPlay icon
  • A placeholder image appears stating that the video is being streamed, essentially turning the desktop app into a remote control for the Apple TV

airplay placeholder

- The placeholder image prevents having two screens and two sets of speakers playing the same video - Playback of the video on Apple TV will start at timecode when the user clicked the AirPlay icon - The scrubber controls on both Apple TV and desktop apps should mirror each other - i.e. the scrubbers should match all the time, and if the user pauses/resumes on either the desktop app or the Apple TV, both scrubbers should pause/resume.

Actual behaviour:

  • The user clicks the AirPlay icon
  • The video on the desktop app rewinds to the start and begins playing again
  • Streaming is not mirrored between the desktop app and Apple TV - i.e. pausing one won't pause the other

This issue leads me to a question - when a user clicks AirPlay, does WebTorrent.app actually re-start the torrent download, or does it stream what the user has already downloaded so far in the desktop app?

Add alternate fullscreen shortcut ⌘+Shift+F

⌘+Shift+F is an alternate to ⌘+Control+F to fullscreen some apps on Mac. Chrome supports it.

The standard on Mac is ⌘+Control+F. That's already supported and should continue to show up as the shortcut in the View menu.

screen shot 2016-03-05 at 3 20 38 pm

UX polish

  • Torrent list
    • Add ability to start and stop torrenting without deleting the torrent
    • Make the + button work
    • Add Blender Foundation torrents for demonstration
    • Play button should turn into a spinner if you click on it before the torrent is ready
  • Player controls
    • Switch from sequential to rarest strategy once the video has buffered far enough
    • Scrubbing
    • Cast buttons
    • Fullscreen toggle button, ESC to exit fullscreen
    • Letterboxing (video should be centered)
    • Platform polish (back button in title bar in OSX, over video on hover in Linux and Windows)
    • Hide the player controls if the mouse hasn't moved for a while
    • Don't hide the player controls when scrubbing, when moused over them, or when paused
  • Cross platform
    • Make it look nice on Ubuntu
    • Make it look nice on Windows

persistent state

Currently the app loses the torrent list every time the main window closes or is reloaded, and when the app is restarted. Ideally state is stored on disk somewhere so that sessions are just resuming what's already been in progress beforehand.

Looking for good modules (or just vanilla solutions, like a state.json?) to solve this issue. Currently avoiding anything that requires native dependencies or grows the dependency graph in a big way.

  • https://github.com/LinusU/node-application-config
    • This module is used by ghauth and has worked well for me in the past. Might be too small for handling things like the torrent list and video playback state once more things need to be tracked, but works for basics and would still be useful for storing application preferences in the future (like default download directory).

Add additional video player keyboard shortcuts

These are the shortcuts that I personally use a lot in VLC:

  • Skip forward 10 seconds (CMD ALT right)
  • Skip back 10 seconds (CMD ALT left)
  • Increase video speed (CMD +)
  • Decrease video speed (CMD -)

video keeps playing on window close

steps to repro

On OS X:

screen shot 2016-03-06 at 11 31 59 am

Play a video. Hit the little red button. Sound keeps going.

Since I think we're just showing/hiding the window on close the video never gets paused.

Create WebTorrent app icon

We need an app icon that shows up in the OS X Dock, Windows Start Menu, etc.

There's already a WebTorrent sticker, so I'm going to start playing around with that as a starting point.

webtorrent-hearts-no-v2

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.