Skip to content

Commit

Permalink
refactor(youtube-player): convert to standalone (#28154)
Browse files Browse the repository at this point in the history
  • Loading branch information
nikos-moysiadis authored Nov 20, 2023
1 parent da692b1 commit 9c06127
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/dev-app/youtube-player/youtube-player-demo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
import {CommonModule} from '@angular/common';
import {FormsModule} from '@angular/forms';
import {MatRadioModule} from '@angular/material/radio';
import {YouTubePlayerModule} from '@angular/youtube-player';
import {YouTubePlayer} from '@angular/youtube-player';
import {MatCheckboxModule} from '@angular/material/checkbox';

interface Video {
Expand Down Expand Up @@ -56,7 +56,7 @@ const VIDEOS: Video[] = [
templateUrl: 'youtube-player-demo.html',
styleUrls: ['youtube-player-demo.css'],
standalone: true,
imports: [CommonModule, FormsModule, MatRadioModule, MatCheckboxModule, YouTubePlayerModule],
imports: [CommonModule, FormsModule, MatRadioModule, MatCheckboxModule, YouTubePlayer],
})
export class YouTubePlayerDemo implements AfterViewInit, OnDestroy {
@ViewChild('demoYouTubePlayer') demoYouTubePlayer: ElementRef<HTMLDivElement>;
Expand Down
4 changes: 2 additions & 2 deletions src/universal-app/kitchen-sink/kitchen-sink.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import {MatDividerModule} from '@angular/material/divider';
import {MatFormFieldModule} from '@angular/material/form-field';
import {MatSortModule} from '@angular/material/sort';
import {MatStepperModule} from '@angular/material/stepper';
import {YouTubePlayerModule} from '@angular/youtube-player';
import {YouTubePlayer} from '@angular/youtube-player';
import {GoogleMapsModule} from '@angular/google-maps';
import {Observable, of as observableOf} from 'rxjs';

Expand Down Expand Up @@ -106,7 +106,7 @@ export class TestEntryComponent {}
DragDropModule,

// Other modules
YouTubePlayerModule,
YouTubePlayer,
GoogleMapsModule,
],
})
Expand Down
4 changes: 2 additions & 2 deletions src/youtube-player/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ If your video is found at https://www.youtube.com/watch?v=PRQCAL_RMVo, then your
```typescript
// example-module.ts
import {NgModule, Component, OnInit} from '@angular/core';
import {YouTubePlayerModule} from '@angular/youtube-player';
import {YouTubePlayer} from '@angular/youtube-player';

@NgModule({
imports: [YouTubePlayerModule],
imports: [YouTubePlayer],
declarations: [YoutubePlayerExample],
})
export class YoutubePlayerExampleModule {
Expand Down
2 changes: 1 addition & 1 deletion src/youtube-player/youtube-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {YouTubePlayer} from './youtube-player';
const COMPONENTS = [YouTubePlayer];

@NgModule({
declarations: COMPONENTS,
imports: COMPONENTS,
exports: COMPONENTS,
})
export class YouTubePlayerModule {}
3 changes: 1 addition & 2 deletions src/youtube-player/youtube-player.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {waitForAsync, ComponentFixture, TestBed} from '@angular/core/testing';
import {Component, ViewChild} from '@angular/core';
import {YouTubePlayerModule} from './youtube-module';
import {YouTubePlayer, DEFAULT_PLAYER_WIDTH, DEFAULT_PLAYER_HEIGHT} from './youtube-player';
import {createFakeYtNamespace} from './fake-youtube-player';
import {Subscription} from 'rxjs';
Expand All @@ -23,7 +22,7 @@ describe('YoutubePlayer', () => {
events = fake.events;

TestBed.configureTestingModule({
imports: [YouTubePlayerModule],
imports: [YouTubePlayer],
declarations: [TestApp, StaticStartEndSecondsApp, NoEventsApp],
});

Expand Down
1 change: 1 addition & 0 deletions src/youtube-player/youtube-player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ interface PendingPlayerState {
selector: 'youtube-player',
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
standalone: true,
// This div is *replaced* by the YouTube player embed.
template: '<div #youtubeContainer></div>',
})
Expand Down
4 changes: 2 additions & 2 deletions tools/public_api_guard/youtube-player/youtube-player.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export class YouTubePlayer implements AfterViewInit, OnChanges, OnDestroy {
set width(width: number | undefined);
youtubeContainer: ElementRef<HTMLElement>;
// (undocumented)
static ɵcmp: i0.ɵɵComponentDeclaration<YouTubePlayer, "youtube-player", never, { "videoId": { "alias": "videoId"; "required": false; }; "height": { "alias": "height"; "required": false; }; "width": { "alias": "width"; "required": false; }; "startSeconds": { "alias": "startSeconds"; "required": false; }; "endSeconds": { "alias": "endSeconds"; "required": false; }; "suggestedQuality": { "alias": "suggestedQuality"; "required": false; }; "playerVars": { "alias": "playerVars"; "required": false; }; "disableCookies": { "alias": "disableCookies"; "required": false; }; "showBeforeIframeApiLoads": { "alias": "showBeforeIframeApiLoads"; "required": false; }; }, { "ready": "ready"; "stateChange": "stateChange"; "error": "error"; "apiChange": "apiChange"; "playbackQualityChange": "playbackQualityChange"; "playbackRateChange": "playbackRateChange"; }, never, never, false, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<YouTubePlayer, "youtube-player", never, { "videoId": { "alias": "videoId"; "required": false; }; "height": { "alias": "height"; "required": false; }; "width": { "alias": "width"; "required": false; }; "startSeconds": { "alias": "startSeconds"; "required": false; }; "endSeconds": { "alias": "endSeconds"; "required": false; }; "suggestedQuality": { "alias": "suggestedQuality"; "required": false; }; "playerVars": { "alias": "playerVars"; "required": false; }; "disableCookies": { "alias": "disableCookies"; "required": false; }; "showBeforeIframeApiLoads": { "alias": "showBeforeIframeApiLoads"; "required": false; }; }, { "ready": "ready"; "stateChange": "stateChange"; "error": "error"; "apiChange": "apiChange"; "playbackQualityChange": "playbackQualityChange"; "playbackRateChange": "playbackRateChange"; }, never, never, true, never>;
// (undocumented)
static ɵfac: i0.ɵɵFactoryDeclaration<YouTubePlayer, never>;
}
Expand All @@ -80,7 +80,7 @@ export class YouTubePlayerModule {
// (undocumented)
static ɵinj: i0.ɵɵInjectorDeclaration<YouTubePlayerModule>;
// (undocumented)
static ɵmod: i0.ɵɵNgModuleDeclaration<YouTubePlayerModule, [typeof i1.YouTubePlayer], never, [typeof i1.YouTubePlayer]>;
static ɵmod: i0.ɵɵNgModuleDeclaration<YouTubePlayerModule, never, [typeof i1.YouTubePlayer], [typeof i1.YouTubePlayer]>;
}

// (No @packageDocumentation comment for this package)
Expand Down

0 comments on commit 9c06127

Please sign in to comment.