Merge pull request #1641 from webtorrent/electron-6

Update to Electron 6
This commit is contained in:
Feross Aboukhadijeh
2019-08-13 13:05:56 -07:00
committed by GitHub
6 changed files with 18 additions and 13 deletions

View File

@@ -13,6 +13,8 @@ const menu = require('./menu')
const State = require('../renderer/lib/state')
const windows = require('./windows')
const WEBTORRENT_VERSION = require('webtorrent/package.json').version
let shouldQuit = false
let argv = sliceArgv(process.argv)
@@ -96,6 +98,12 @@ function init () {
})
}
// Enable app logging into default directory, i.e. /Library/Logs/WebTorrent
// on Mac, %APPDATA% on Windows, $XDG_CONFIG_HOME or ~/.config on Linux.
app.setAppLogsPath()
app.userAgentFallback = `WebTorrent/${WEBTORRENT_VERSION} (https://webtorrent.io)`
app.on('open-file', onOpen)
app.on('open-url', onOpen)

View File

@@ -74,7 +74,7 @@ function reset () {
// Track screen resolution
function getScreenInfo () {
return electron.screen.getAllDisplays().map((screen) => ({
return electron.remote.screen.getAllDisplays().map((screen) => ({
width: screen.size.width,
height: screen.size.height,
scaleFactor: screen.scaleFactor

View File

@@ -1,3 +1,5 @@
/* global HTMLMediaElement */
const React = require('react')
const Bitfield = require('bitfield')
const prettyBytes = require('prettier-bytes')
@@ -127,7 +129,8 @@ function renderMedia (state) {
onError={dispatcher('mediaError')}
onTimeUpdate={dispatcher('mediaTimeUpdate')}
onEncrypted={dispatcher('mediaEncrypted')}
onCanPlay={onCanPlay}>
onCanPlay={onCanPlay}
>
{trackTags}
</MediaTagName>
)
@@ -166,6 +169,7 @@ function renderMedia (state) {
function onCanPlay (e) {
const elem = e.target
if (elem.readyState < HTMLMediaElement.HAVE_FUTURE_DATA) return
if (state.playing.type === 'video' &&
elem.webkitVideoDecodedByteCount === 0) {
dispatch('mediaError', 'Video codec unsupported')