@@ -19,7 +19,6 @@ import {
19
19
Output ,
20
20
ViewChild ,
21
21
ViewEncapsulation ,
22
- Inject ,
23
22
PLATFORM_ID ,
24
23
OnChanges ,
25
24
SimpleChanges ,
@@ -131,19 +130,21 @@ enum PlayerState {
131
130
` ,
132
131
} )
133
132
export class YouTubePlayer implements AfterViewInit , OnChanges , OnDestroy {
134
- /** Whether we're currently rendering inside a browser. */
135
- private readonly _isBrowser : boolean ;
133
+ private _ngZone = inject ( NgZone ) ;
134
+ private readonly _nonce = inject ( CSP_NONCE , { optional : true } ) ;
135
+ private readonly _changeDetectorRef = inject ( ChangeDetectorRef ) ;
136
136
private _player : YT . Player | undefined ;
137
137
private _pendingPlayer : YT . Player | undefined ;
138
138
private _existingApiReadyCallback : ( ( ) => void ) | undefined ;
139
139
private _pendingPlayerState : PendingPlayerState | undefined ;
140
140
private readonly _destroyed = new Subject < void > ( ) ;
141
141
private readonly _playerChanges = new BehaviorSubject < YT . Player | undefined > ( undefined ) ;
142
- private readonly _nonce = inject ( CSP_NONCE , { optional : true } ) ;
143
- private readonly _changeDetectorRef = inject ( ChangeDetectorRef ) ;
144
142
protected _isLoading = false ;
145
143
protected _hasPlaceholder = true ;
146
144
145
+ /** Whether we're currently rendering inside a browser. */
146
+ private readonly _isBrowser : boolean ;
147
+
147
148
/** YouTube Video ID to view */
148
149
@Input ( )
149
150
videoId : string | undefined ;
@@ -241,10 +242,10 @@ export class YouTubePlayer implements AfterViewInit, OnChanges, OnDestroy {
241
242
@ViewChild ( 'youtubeContainer' , { static : true } )
242
243
youtubeContainer : ElementRef < HTMLElement > ;
243
244
244
- constructor (
245
- private _ngZone : NgZone ,
246
- @ Inject ( PLATFORM_ID ) platformId : Object ,
247
- ) {
245
+ constructor ( ... args : unknown [ ] ) ;
246
+
247
+ constructor ( ) {
248
+ const platformId = inject < Object > ( PLATFORM_ID ) ;
248
249
const config = inject ( YOUTUBE_PLAYER_CONFIG , { optional : true } ) ;
249
250
this . loadApi = config ?. loadApi ?? true ;
250
251
this . disablePlaceholder = ! ! config ?. disablePlaceholder ;
0 commit comments