[Mobile Web, iOS 10, Safari] Clicking 'Play' on a YouTube video doesn't actually start the video

Hello,

I have a Python Appium setup. What I’m trying to do is go to a YouTube watch page using iOS 10 Safari and click Play to start a video. Unfortunately no matter what I try, it doesn’t work.

  1. At first I tried using click.
    self.driver.get('https://www.youtube.com/watch?v=dQw4w9WgXcQ')
    play_button = self.driver.find_element_by_css_selector('[aria-label="Play"]')
    play_button.click()

The test gets to the watch page, there’s a red play button, the test clicks it however instead of actually playing the video you then see a Native iOS Play button and nothing plays.

  1. I tried using tap.
    self.driver.get('https://www.youtube.com/watch?v=dQw4w9WgXcQ')
    play_button = self.driver.find_element_by_css_selector('[aria-label="Play"]')
    action = TouchAction(self.driver)
    action.tap(play_button).perform()

The test gets to the watch page, there’s a red play button, the test claims that tapping that button work but the button never actually gets tapped so it’s still there. Doesn’t even get to the Native iOS Play button.

  1. I tried starting the play via script.

self.driver.get(‘https://www.youtube.com/watch?v=dQw4w9WgXcQ’)
movie_player = self.driver.find_element_by_css_selector(‘#movie_player’)
self.driver.execute_script(‘arguments[0].playVideo();’, movie_player)
Same thing as with click. The red play button disappeared but the iOS native play button persisted and the video never actually played.

I’m not sure, but I’m guessing this has to do with iOS blocking scripted attempts to play the player. However shouldn’t doing tap or click basically re-create what a real user would do and cause a real tap action to happen?

Thank you.