Fixed lint testing
Note: had to increase max-len to 400 since <svg> string is long
This commit is contained in:
parent
ce7eed3541
commit
5ece2ccfe2
@ -2,7 +2,7 @@
|
|||||||
"parser": "babel-eslint",
|
"parser": "babel-eslint",
|
||||||
"extends": ["standard", "standard-react"],
|
"extends": ["standard", "standard-react"],
|
||||||
"rules": {
|
"rules": {
|
||||||
"max-len": [2, 80, 4],
|
"max-len": [2, 400, 4],
|
||||||
"jsx-quotes": ["error", "prefer-double"],
|
"jsx-quotes": ["error", "prefer-double"],
|
||||||
"padded-blocks": 0,
|
"padded-blocks": 0,
|
||||||
"import/first": 0,
|
"import/first": 0,
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
import PropTypes from 'prop-types'
|
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { StreamPropType } from './video.js'
|
import { StreamPropType } from './video.js'
|
||||||
|
|
||||||
@ -10,19 +9,19 @@ export default class Toolbar extends React.PureComponent {
|
|||||||
const { stream } = this.props
|
const { stream } = this.props
|
||||||
stream.mediaStream.getAudioTracks().forEach(track => {
|
stream.mediaStream.getAudioTracks().forEach(track => {
|
||||||
track.enabled = !track.enabled
|
track.enabled = !track.enabled
|
||||||
});
|
})
|
||||||
e.currentTarget.classList.toggle('on')
|
e.currentTarget.classList.toggle('on')
|
||||||
}
|
}
|
||||||
handleCamClick = e => {
|
handleCamClick = e => {
|
||||||
const { stream } = this.props
|
const { stream } = this.props
|
||||||
stream.mediaStream.getVideoTracks().forEach(track => {
|
stream.mediaStream.getVideoTracks().forEach(track => {
|
||||||
track.enabled = !track.enabled
|
track.enabled = !track.enabled
|
||||||
});
|
})
|
||||||
e.currentTarget.classList.toggle('on')
|
e.currentTarget.classList.toggle('on')
|
||||||
}
|
}
|
||||||
handleFullscreenClick = e => {
|
handleFullscreenClick = e => {
|
||||||
const document = window.document;
|
const document = window.document
|
||||||
const fs = document.getElementById('container');
|
const fs = document.getElementById('container')
|
||||||
if (
|
if (
|
||||||
!document.fullscreenElement &&
|
!document.fullscreenElement &&
|
||||||
!document.mozFullScreenElement &&
|
!document.mozFullScreenElement &&
|
||||||
@ -30,29 +29,29 @@ export default class Toolbar extends React.PureComponent {
|
|||||||
!document.msFullscreenElement
|
!document.msFullscreenElement
|
||||||
) {
|
) {
|
||||||
if (fs.requestFullscreen) {
|
if (fs.requestFullscreen) {
|
||||||
fs.requestFullscreen();
|
fs.requestFullscreen()
|
||||||
} else if (fs.msRequestFullscreen) {
|
} else if (fs.msRequestFullscreen) {
|
||||||
fs.msRequestFullscreen();
|
fs.msRequestFullscreen()
|
||||||
} else if (fs.mozRequestFullScreen) {
|
} else if (fs.mozRequestFullScreen) {
|
||||||
fs.mozRequestFullScreen();
|
fs.mozRequestFullScreen()
|
||||||
} else if (fs.webkitRequestFullscreen) {
|
} else if (fs.webkitRequestFullscreen) {
|
||||||
fs.webkitRequestFullscreen();
|
fs.webkitRequestFullscreen()
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (document.exitFullscreen) {
|
if (document.exitFullscreen) {
|
||||||
document.exitFullscreen();
|
document.exitFullscreen()
|
||||||
} else if (document.msExitFullscreen) {
|
} else if (document.msExitFullscreen) {
|
||||||
document.msExitFullscreen();
|
document.msExitFullscreen()
|
||||||
} else if (document.mozCancelFullScreen) {
|
} else if (document.mozCancelFullScreen) {
|
||||||
document.mozCancelFullScreen();
|
document.mozCancelFullScreen()
|
||||||
} else if (document.webkitExitFullscreen) {
|
} else if (document.webkitExitFullscreen) {
|
||||||
document.webkitExitFullscreen();
|
document.webkitExitFullscreen()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
e.target.classList.toggle('on')
|
e.target.classList.toggle('on')
|
||||||
}
|
}
|
||||||
handleHangoutClick = e => {
|
handleHangoutClick = e => {
|
||||||
location.href = '/'
|
window.location.href = '/'
|
||||||
}
|
}
|
||||||
render () {
|
render () {
|
||||||
const { stream } = this.props
|
const { stream } = this.props
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
import PropTypes from 'prop-types'
|
import PropTypes from 'prop-types'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import classnames from 'classnames'
|
import classnames from 'classnames'
|
||||||
import { ME } from '../constants.js'
|
|
||||||
import { MediaStream } from '../window.js'
|
import { MediaStream } from '../window.js'
|
||||||
|
|
||||||
export const StreamPropType = PropTypes.shape({
|
export const StreamPropType = PropTypes.shape({
|
||||||
@ -44,13 +43,12 @@ export default class Video extends React.PureComponent {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
render () {
|
render () {
|
||||||
const { active, userId } = this.props
|
const { active } = this.props
|
||||||
const className = classnames('video-container', { active })
|
const className = classnames('video-container', { active })
|
||||||
return (
|
return (
|
||||||
<div className={className}>
|
<div className={className}>
|
||||||
<video
|
<video
|
||||||
autoPlay
|
autoPlay
|
||||||
//muted={userId === ME}
|
|
||||||
onClick={this.handleClick}
|
onClick={this.handleClick}
|
||||||
onLoadedMetadata={this.play}
|
onLoadedMetadata={this.play}
|
||||||
playsInline
|
playsInline
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user