-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #100 from abritopach/develop
Develop
- Loading branch information
Showing
18 changed files
with
213 additions
and
39 deletions.
There are no files selected for viewing
6 changes: 3 additions & 3 deletions
6
examples/ionic-test-capacitor-youtube-player/package-lock.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 5 additions & 10 deletions
15
examples/ionic-test-capacitor-youtube-player/src/app/pages/home/home.module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 3 additions & 11 deletions
14
...test-capacitor-youtube-player/src/app/pages/styled-video-list/styled-video-list.module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 3 additions & 11 deletions
14
examples/ionic-test-capacitor-youtube-player/src/app/pages/video-list/video-list.module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
...st-capacitor-youtube-player/src/app/pages/video-playlist/video-playlist-routing.module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { Routes, RouterModule } from '@angular/router'; | ||
|
||
import { VideoPlaylistPage } from './video-playlist.page'; | ||
|
||
const routes: Routes = [ | ||
{ | ||
path: '', | ||
component: VideoPlaylistPage | ||
} | ||
]; | ||
|
||
@NgModule({ | ||
imports: [RouterModule.forChild(routes)], | ||
exports: [RouterModule], | ||
}) | ||
export class VideoPlaylistPageRoutingModule {} |
14 changes: 14 additions & 0 deletions
14
...ionic-test-capacitor-youtube-player/src/app/pages/video-playlist/video-playlist.module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { SharedModule } from 'src/app/shared/shared.module'; | ||
import { VideoPlaylistPageRoutingModule } from './video-playlist-routing.module'; | ||
|
||
import { VideoPlaylistPage } from './video-playlist.page'; | ||
|
||
@NgModule({ | ||
imports: [ | ||
SharedModule, | ||
VideoPlaylistPageRoutingModule | ||
], | ||
declarations: [VideoPlaylistPage] | ||
}) | ||
export class VideoPlaylistPageModule {} |
28 changes: 28 additions & 0 deletions
28
...ionic-test-capacitor-youtube-player/src/app/pages/video-playlist/video-playlist.page.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<ion-header> | ||
<ion-toolbar color="primary"> | ||
<ion-buttons buttons-start slot="start"> | ||
<ion-menu-button></ion-menu-button> | ||
</ion-buttons> | ||
<ion-title> | ||
Test Capacitor Youtube Player Plugin | ||
</ion-title> | ||
</ion-toolbar> | ||
</ion-header> | ||
|
||
<ion-content> | ||
<!-- The <iframe> (and video player) will replace this <div> tag. --> | ||
<p>Playlist using cuePlaylist</p> | ||
<div id="youtube-player-playlist1"></div> | ||
<p>Playlist using loadPlaylist</p> | ||
<div id="youtube-player-playlist2"></div> | ||
</ion-content> | ||
|
||
<ion-footer> | ||
<ion-toolbar color="primary"> | ||
<ion-title class="footer-title">© {{ currentYear }} Adrián Brito Pacheco</ion-title> | ||
<ion-buttons slot="end"> | ||
<ntkme-github-button user="abritopach" repo="capacitor-youtube-player" style="margin-right: 5px;"></ntkme-github-button> | ||
<ntkme-github-button user="abritopach" type="follow"></ntkme-github-button> | ||
</ion-buttons> | ||
</ion-toolbar> | ||
</ion-footer> |
Empty file.
24 changes: 24 additions & 0 deletions
24
...ic-test-capacitor-youtube-player/src/app/pages/video-playlist/video-playlist.page.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; | ||
import { IonicModule } from '@ionic/angular'; | ||
|
||
import { VideoPlaylistPage } from './video-playlist.page'; | ||
|
||
describe('VideoPlaylistPage', () => { | ||
let component: VideoPlaylistPage; | ||
let fixture: ComponentFixture<VideoPlaylistPage>; | ||
|
||
beforeEach(waitForAsync(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ VideoPlaylistPage ], | ||
imports: [IonicModule.forRoot()] | ||
}).compileComponents(); | ||
|
||
fixture = TestBed.createComponent(VideoPlaylistPage); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
})); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
48 changes: 48 additions & 0 deletions
48
...s/ionic-test-capacitor-youtube-player/src/app/pages/video-playlist/video-playlist.page.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { AfterViewInit, Component, OnInit } from '@angular/core'; | ||
import { Capacitor } from '@capacitor/core'; | ||
import { YoutubePlayer } from 'capacitor-youtube-player'; | ||
import { IPlayerOptions, IPlaylistOptions } from 'capacitor-youtube-player/dist/esm/web/models/models'; | ||
|
||
@Component({ | ||
selector: 'app-video-playlist', | ||
templateUrl: './video-playlist.page.html', | ||
styleUrls: ['./video-playlist.page.scss'], | ||
}) | ||
export class VideoPlaylistPage implements OnInit, AfterViewInit { | ||
|
||
currentYear = new Date().getFullYear(); | ||
|
||
constructor() { } | ||
|
||
ngOnInit() { | ||
} | ||
|
||
ngAfterViewInit() { | ||
if (Capacitor.getPlatform() === 'web') { | ||
this.initializeYoutubePlayerPluginWeb(); | ||
} | ||
} | ||
|
||
async initializeYoutubePlayerPluginWeb() { | ||
console.log('HomePage::initializeYoutubePlayerPluginWeb() | method called'); | ||
|
||
const optionsPlayer1: IPlayerOptions = {playerId: 'youtube-player-playlist1', playerSize: {width: 640, height: 360}, videoId: 'atAeP-rR8Xs', fullscreen: false, debug: true}; | ||
const resultPlayer1 = await YoutubePlayer.initialize(optionsPlayer1); | ||
console.log('playerReady', resultPlayer1); | ||
|
||
const playlistOptions1: IPlaylistOptions = {listType: 'playlist', list: 'PLOMESIqyrpf-A8O-Hym9pvX1D4vDSDcDT'}; | ||
const resultCuePlaylist = await YoutubePlayer.cuePlaylist('youtube-player-playlist1', playlistOptions1); | ||
console.log('cuePlaylist', resultCuePlaylist); | ||
|
||
|
||
const optionsPlayer2: IPlayerOptions = {playerId: 'youtube-player-playlist2', playerSize: {width: 640, height: 360}, videoId: 'OB2zbmS7bW4', fullscreen: false, debug: true}; | ||
const resultPlayer2 = await YoutubePlayer.initialize(optionsPlayer2); | ||
console.log('playerReady', resultPlayer2); | ||
|
||
const playlistOptions2: IPlaylistOptions = {listType: 'playlist', list: 'PLOMESIqyrpf8yoq4MbK28VemFpoX9PB7k'}; | ||
const resultLoadPlaylist = await YoutubePlayer.loadPlaylist('youtube-player-playlist2', playlistOptions2); | ||
console.log('loadPlaylist', resultLoadPlaylist); | ||
|
||
} | ||
|
||
} |
18 changes: 18 additions & 0 deletions
18
examples/ionic-test-capacitor-youtube-player/src/app/shared/shared.module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
import { FormsModule, ReactiveFormsModule } from '@angular/forms'; | ||
import { IonicModule } from '@ionic/angular'; | ||
import { NtkmeButtonModule } from '@ctrl/ngx-github-buttons'; | ||
|
||
@NgModule({ | ||
declarations: [], | ||
imports: [ | ||
CommonModule, | ||
FormsModule, | ||
ReactiveFormsModule, | ||
IonicModule, | ||
NtkmeButtonModule | ||
], | ||
exports: [CommonModule, FormsModule, IonicModule, NtkmeButtonModule] | ||
}) | ||
export class SharedModule { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters