How it works

Step 1
Create an ionic angular app or use an existing one. We will create a new one using the "tabs" template.

ionic start myApp tabs

Step 2
Install the following dependencies

ionic cordova plugin add cordova-plugin-advanced-http

npm install ionic-youtube-search --save

Step 3
Open the app in your IDE

Step 4
Import the "ionic-youtube-search" dependency in your *.page.ts

import * as youtube from 'ionic-youtube-search';

Step 5
Create a method for fetching the youtube stream based on a video id. Then create a second method for playing the stream.

  videos = [];
  searchModel = '';
  async search() {
    this.videos = await;

Step 6
Create a UI element e.g. a button, which list all the videos

   <ion-searchbar autocomplete="on" debounce="800" animated [(ngModel)]="searchModel" (ionClear)="videos = []" (ionChange)="search()"></ion-searchbar>

      Recent Conversations

    <ion-item *ngFor="let video of videos">
      <ion-avatar slot="start">
        <img [src]="video.snippet.thumbnails.high.url">

Step 7
Start the app in your emulator and test

ionic cordova emulate ios -l -c --target "YOUR SIMULATOR ID" -- --buildFlag="-UseModernBuildSystem=0"