Skip to content

Commit eaff142

Browse files
authored
refactor(youtube-player): change deprecated APIs for version 10 (#19348)
1 parent caad0b5 commit eaff142

File tree

2 files changed

+4
-15
lines changed

2 files changed

+4
-15
lines changed

src/youtube-player/youtube-player.ts

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import {
2121
Output,
2222
ViewChild,
2323
ViewEncapsulation,
24-
Optional,
2524
Inject,
2625
PLATFORM_ID,
2726
} from '@angular/core';
@@ -187,17 +186,8 @@ export class YouTubePlayer implements AfterViewInit, OnDestroy, OnInit {
187186
@ViewChild('youtubeContainer')
188187
youtubeContainer: ElementRef<HTMLElement>;
189188

190-
constructor(
191-
private _ngZone: NgZone,
192-
/**
193-
* @deprecated `platformId` parameter to become required.
194-
* @breaking-change 10.0.0
195-
*/
196-
@Optional() @Inject(PLATFORM_ID) platformId?: Object) {
197-
198-
// @breaking-change 10.0.0 Remove null check for `platformId`.
199-
this._isBrowser =
200-
platformId ? isPlatformBrowser(platformId) : typeof window === 'object' && !!window;
189+
constructor(private _ngZone: NgZone, @Inject(PLATFORM_ID) platformId: Object) {
190+
this._isBrowser = isPlatformBrowser(platformId);
201191
}
202192

203193
ngOnInit() {

tools/public_api_guard/youtube-player/youtube-player.d.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ export declare class YouTubePlayer implements AfterViewInit, OnDestroy, OnInit {
1616
get width(): number | undefined;
1717
set width(width: number | undefined);
1818
youtubeContainer: ElementRef<HTMLElement>;
19-
constructor(_ngZone: NgZone,
20-
platformId?: Object);
19+
constructor(_ngZone: NgZone, platformId: Object);
2120
createEventsBoundInZone(): YT.Events;
2221
getAvailablePlaybackRates(): number[];
2322
getAvailableQualityLevels(): YT.SuggestedVideoQuality[];
@@ -43,7 +42,7 @@ export declare class YouTubePlayer implements AfterViewInit, OnDestroy, OnInit {
4342
stopVideo(): void;
4443
unMute(): void;
4544
static ɵcmp: i0.ɵɵComponentDefWithMeta<YouTubePlayer, "youtube-player", never, { "videoId": "videoId"; "height": "height"; "width": "width"; "startSeconds": "startSeconds"; "endSeconds": "endSeconds"; "suggestedQuality": "suggestedQuality"; "showBeforeIframeApiLoads": "showBeforeIframeApiLoads"; }, { "ready": "ready"; "stateChange": "stateChange"; "error": "error"; "apiChange": "apiChange"; "playbackQualityChange": "playbackQualityChange"; "playbackRateChange": "playbackRateChange"; }, never, never>;
46-
static ɵfac: i0.ɵɵFactoryDef<YouTubePlayer, [null, { optional: true; }]>;
45+
static ɵfac: i0.ɵɵFactoryDef<YouTubePlayer, never>;
4746
}
4847

4948
export declare class YouTubePlayerModule {

0 commit comments

Comments
 (0)