Youtube video unavailable on ios App

Hello everybody,
I hope you could help me.

I have created an app with ionic-v4 that uses iframe for showing some videos from youtube.

Every video works for android, while in ios every video but 3 are played correctly.

The iframe loads correctly the preview of the video, but when I click on play, it says video unavailable. Just three videos on 25.

We have tried to remove those 3 videos from youtube and the to resubmit them on the tube, yesterday night it worked, now they don’t work again.

What can be happened? Something about permissions or similar?

These are the videos that are not playing in ios

https://www.youtube.com/watch?v=5SRvoELJDw8
https://www.youtube.com/watch?v=Fj2KWJevFSI
https://www.youtube.com/watch?v=xxuv_zp5Fhs

and this is an example of video that is played correctly in ios

https://www.youtube.com/watch?v=ieL7Bzcu9Ow

And this is the code I use:

html:

(item.linkYoutube is the id of the youtube video, i.g. 5SRvoELJDw8 for the first video i posted)

    <iframe width="100%" height="250" [src]="getLinkYouTubeEmbedded(item.linkYoutube) | safe" frameborder="0" allowfullscreen>
    </iframe>

ts:

getLinkYouTubeEmbedded(x: string): string { return 'https://www.youtube.com/embed/' + x; }

pipe safe:

import { Pipe, PipeTransform } from ‘@angular/core’;
import { DomSanitizer } from ‘@angular/platform-browser’;

@Pipe({
name: ‘safe’
})
export class SafePipe implements PipeTransform {

constructor(private sanitizer: DomSanitizer) { }
transform(url) {
return this.sanitizer.bypassSecurityTrustResourceUrl(url);
}

}

Thank you in advance.

1 Like

Hi, I have the same problem, did you find a solution for this?

There are several issues causing this problem. A few of the reasons why you might get such error include:

  • There is a possibility that the video violates YouTube policy.
  • The cache got corrupted and needs to be cleared.
  • There may be a reason for the poor quality of the video.
  • There may be an issue with the internet speed.

You can try out some options to avoid such situations of non-availability of your favorite videos. A few recommended options include:

  • Try to reinstall your web browser.
  • You can try a different browser to play the desired youtube video.
  • Enable Flash and JavaScript.
  • Deleting Cookies
  • Update GPU drivers.