Skip to content
Permalink
Browse files

Fix client with google bot

  • Loading branch information...
Chocobozzz committed Feb 8, 2019
1 parent 4429c04 commit c36abf7ad42e341ba88e6acf3253185b0da20e42
Showing with 648 additions and 596 deletions.
  1. +16 −15 client/package.json
  2. +1 −2 client/src/app/videos/+video-watch/video-watch.component.ts
  3. +1 −1 client/src/main.ts
  4. +630 −578 client/yarn.lock
@@ -28,7 +28,8 @@
"resolutions": {
"video.js": "^7",
"webtorrent/create-torrent/junk": "^1",
"simple-get": "^2.8.1"
"simple-get": "^2.8.1",
"punycode": "^1.4.1"
},
"jest": {
"globals": {
@@ -63,20 +64,20 @@
"setupTestFrameworkScriptFile": "<rootDir>/src/setupJest.ts"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.11.1",
"@angular/animations": "~7.1.1",
"@angular/cli": "~7.1.1",
"@angular/common": "~7.1.1",
"@angular/compiler": "~7.1.1",
"@angular/compiler-cli": "~7.1.1",
"@angular/core": "~7.1.1",
"@angular/forms": "~7.1.1",
"@angular/http": "~7.1.1",
"@angular/language-service": "~7.1.1",
"@angular/platform-browser": "~7.1.1",
"@angular/platform-browser-dynamic": "~7.1.1",
"@angular/router": "~7.1.1",
"@angular/service-worker": "~7.1.1",
"@angular-devkit/build-angular": "~0.13.1",
"@angular/animations": "~7.2.4",
"@angular/cli": "~7.3.1",
"@angular/common": "~7.2.4",
"@angular/compiler": "~7.2.4",
"@angular/compiler-cli": "~7.2.4",
"@angular/core": "~7.2.4",
"@angular/forms": "~7.2.4",
"@angular/http": "~7.2.4",
"@angular/language-service": "~7.2.4",
"@angular/platform-browser": "~7.2.4",
"@angular/platform-browser-dynamic": "~7.2.4",
"@angular/router": "~7.2.4",
"@angular/service-worker": "~7.2.4",
"@angularclass/hmr": "^2.1.3",
"@neos21/bootstrap3-glyphicons": "^1.0.1",
"@ng-bootstrap/ng-bootstrap": "^4.0.0",
@@ -8,7 +8,6 @@ import { MetaService } from '@ngx-meta/core'
import { Notifier, ServerService } from '@app/core'
import { forkJoin, Subscription } from 'rxjs'
import { Hotkey, HotkeysService } from 'angular2-hotkeys'
import * as WebTorrent from 'webtorrent'
import { UserVideoRateType, VideoCaption, VideoPrivacy, VideoState } from '../../../../../shared'
import { AuthService, ConfirmService } from '../../core'
import { RestExtractor, VideoBlacklistService } from '../../shared'
@@ -90,7 +89,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {

ngOnInit () {
if (
WebTorrent.WEBRTC_SUPPORT === false ||
!!((window as any).RTCPeerConnection || (window as any).mozRTCPeerConnection || (window as any).webkitRTCPeerConnection) === false ||
peertubeLocalStorage.getItem(VideoWatchComponent.LOCAL_STORAGE_PRIVACY_CONCERN_KEY) === 'true'
) {
this.hasAlreadyAcceptedPrivacyConcern = true
@@ -34,7 +34,7 @@ const bootstrap = () => platformBrowserDynamic()
// .catch(err => console.error('Cannot register service worker.', err))
// }

if (navigator.serviceWorker) {
if (navigator.serviceWorker && typeof navigator.serviceWorker.getRegistrations === 'function') {
navigator.serviceWorker.getRegistrations()
.then(registrations => {
for (const registration of registrations) {

2 comments on commit c36abf7

@tcitworld

This comment has been minimized.

Copy link
Collaborator

replied Feb 8, 2019

Is this related to this PR ? :)

@Chocobozzz

This comment has been minimized.

Copy link
Owner Author

replied Feb 9, 2019

Yep because we still had import * as WebTorrent from 'webtorrent' in the watch component (we should lazy load it in the webtorrent plugin instead).

Please sign in to comment.
You can’t perform that action at this time.