Saturday, June 3, 2017

Android video plays on iOS device but not on Android device

Leave a Comment

I have a strange situation where:

  • Android recorded video plays on an iPhone but not on an Android device
  • iPhone recorded videos play on both iPhones and Android devices

The HTML I use is:

          <video controls="controls">             <source type="video/quicktime" [src]="sanitizer.bypassSecurityTrustResourceUrl(step.attachment)">             <source type="video/mp4" [src]="sanitizer.bypassSecurityTrustResourceUrl(step.attachment)">           </video> 

The step.attachment is a base64 file.

My App is built with ionic 2

1 Answers

Answers 1

This should be a comment but I don't have enough rep to comment.

Perhaps explicitly determine the OS of the phone first and only define the video source for that OS.

For instance, the following algorithm:

if OS == Android, video controls source type="video/mp4"

else if OS == iOS, video controls source type="video/quicktime"

Although I don't see why what you have should work, hopefully you loose nothing trying this.

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment