TheWidlarzGroup / react-native-video

A <Video /> component for react-native
https://docs.thewidlarzgroup.com/react-native-video/
MIT License
7.2k stars 2.9k forks source link

Preroll Ad Plays a Second After the Main Video Starts Playing #3114

Open jonathankiefer opened 1 year ago

jonathankiefer commented 1 year ago

Bug

This issue is not present on Android or Android TV. It also doesn't appear when using Google IMA sample tags.

Platform

Which player are you experiencing the problem on:

Environment info

Library version: 6.0.0-alpha.6

Steps To Reproduce

  1. Setup a standard sample project with Google IMA and an adTagUrl with a preroll ad break.
  2. Play a video

Expected behaviour

Main video doesn't start until preroll ad is finished.

Video sample

https://drive.google.com/file/d/1W6D7Rmg5ToIID3yHQV30J5vWJFMrBEOl/view?usp=sharing

YashRaj2003 commented 1 year ago

this may be due to client side insertion.

I am trying to implement Ima ads by providing adurl in adTagUrl property, mine is not working. can you help

benacler commented 11 months ago

same problem here, do you found a workaround ?

YashRaj2003 commented 11 months ago

Install the beta release and activate imaads true in Android folder.

And ad tag url will work

benacler commented 11 months ago

i do not have problems with the adTagURL, but with the main video playing for a fraction of second before the ads starts

YashRaj2003 commented 11 months ago

This is an issue because ad is being loaded on client side which usually takes 2-3 sec.

The one way I had figured out was by default let the video must be paused. Also add source using a settimeout function.

And when ad playing status is finished/completed then make the video source playback status to true.

This way has some drawbacks too.

YashRaj2003 commented 11 months ago

This is an issue because ad is being loaded on client side which usually takes 2-3 sec.

The one way I had figured out was by default let the video must be paused. Also add source using a settimeout function.

And when ad playing status is finished/completed then make the video source playback status to true.

This way has some drawbacks too.

On Thu, 30 Nov 2023, 11:12 pm Leonardo Bernardini, @.***> wrote:

i do not have problems with the adTagURL, but with the main video playing for a fraction of second before the ads starts

— Reply to this email directly, view it on GitHub https://github.com/react-native-video/react-native-video/issues/3114#issuecomment-1834259800, or unsubscribe https://github.com/notifications/unsubscribe-auth/AU3ARBXDWDIJRIZGKU5HMS3YHDAQZAVCNFSM6AAAAAAXSJIKI6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMZUGI2TSOBQGA . You are receiving this because you commented.Message ID: @.***>

benacler commented 11 months ago

If I pause the video, the ads do not load until I start it, I already tried this way but does not work

ChadyAyoub4 commented 5 months ago

Im having the same issue, did anyone find a workaround.

benacler commented 5 months ago

Hi there,

Yes but’s a dirty workaround.

I play to video hidden with opacity 0 and muted until I get the event of AD Started . When the AD Starts or the AD gives e a pre-load error, I resume the opacity of the video. Be aware that you need to tweak this with the opacity , if you hide the component, It will reset,

Cheers

github-actions[bot] commented 3 weeks ago

This issue is stale because it has been open for 30 days with no activity. If there won't be any activity in the next 14 days, this issue will be closed automatically.