videojs / videojs-youtube

YouTube playback technology for Video.js
1.13k stars 547 forks source link

Advert Preroll on iOS crashes. #616

Open praznovskymartin opened 10 months ago

praznovskymartin commented 10 months ago

Hi, I have a specific case where I put preroll advertisements through ima sdk before my youtube videos. Everything works fine except the iOS environment where it breaks on the following error:

ima3.js:551 Uncaught TypeError: Cannot read properties of undefined (reading 'length')

The sample code is directly from google-ima with the youtube 3.0.1 integrated as here. You can take it from there and see it working, except on iOS (emulation is enough).

I'm reaching out to you as there is only an issue with the youtube-tech. Please advise.

Thanks in advance.

mister-ben commented 10 months ago

IMA is trying to access a nonexistent seekable property on the youtube iframe. The problem is that videojs-ima assumes that the playback tech element is a video element, which is not the case with the youtube tech.

praznovskymartin commented 10 months ago

Hi @mister-ben ,

thanks for looking into this. Please, do you have any suggestion for a workaround? The issue is, that is only occures for iOs environment.