mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-04-17 18:31:29 +03:00
iOS is now checked by the cdk platform component
This commit is contained in:
@@ -17,6 +17,7 @@ import 'rxjs/add/operator/switch'
|
|||||||
import { YoutubeSearchService, Result } from '../youtube-search.service';
|
import { YoutubeSearchService, Result } from '../youtube-search.service';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { CreatePlaylistComponent } from 'app/create-playlist/create-playlist.component';
|
import { CreatePlaylistComponent } from 'app/create-playlist/create-playlist.component';
|
||||||
|
import { Platform } from '@angular/cdk/platform';
|
||||||
|
|
||||||
export let audioFilesMouseHovering = false;
|
export let audioFilesMouseHovering = false;
|
||||||
export let videoFilesMouseHovering = false;
|
export let videoFilesMouseHovering = false;
|
||||||
@@ -166,7 +167,7 @@ export class MainComponent implements OnInit {
|
|||||||
last_url_check = 0;
|
last_url_check = 0;
|
||||||
|
|
||||||
constructor(private postsService: PostsService, private youtubeSearch: YoutubeSearchService, public snackBar: MatSnackBar,
|
constructor(private postsService: PostsService, private youtubeSearch: YoutubeSearchService, public snackBar: MatSnackBar,
|
||||||
private router: Router, public dialog: MatDialog) {
|
private router: Router, public dialog: MatDialog, private platform: Platform) {
|
||||||
this.audioOnly = false;
|
this.audioOnly = false;
|
||||||
|
|
||||||
|
|
||||||
@@ -330,7 +331,8 @@ export class MainComponent implements OnInit {
|
|||||||
|
|
||||||
// app initialization.
|
// app initialization.
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.iOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window['MSStream'];
|
// this.iOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window['MSStream'];
|
||||||
|
this.iOS = this.platform.IOS;
|
||||||
|
|
||||||
if (localStorage.getItem('audioOnly') !== null) {
|
if (localStorage.getItem('audioOnly') !== null) {
|
||||||
this.audioOnly = localStorage.getItem('audioOnly') === 'true';
|
this.audioOnly = localStorage.getItem('audioOnly') === 'true';
|
||||||
@@ -564,7 +566,6 @@ export class MainComponent implements OnInit {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const parsed_infos = this.getAudioAndVideoFormats(infos.formats);
|
const parsed_infos = this.getAudioAndVideoFormats(infos.formats);
|
||||||
console.log(parsed_infos);
|
|
||||||
const available_formats = {audio: parsed_infos[0], video: parsed_infos[1]};
|
const available_formats = {audio: parsed_infos[0], video: parsed_infos[1]};
|
||||||
this.cachedAvailableFormats[url]['formats'] = available_formats;
|
this.cachedAvailableFormats[url]['formats'] = available_formats;
|
||||||
}, err => {
|
}, err => {
|
||||||
|
|||||||
Reference in New Issue
Block a user