Using Selenium verify player has played ad and once ad finished it started playing video. example youtube. So console will show like ok ad is over and video being played successfully

I am new to appium and started learning myself … i asked one Question before here and it is really helpful but after that got busy with Office work and cud not continue learning… Well i am trying automate youtube… well if you have any other video player app on android or iOS … can you share selenium code?

Thank you all