Esempio n. 1
0
    def check_src(self, src_type, url):
        # Why wait to check src until initial ad is done playing?
        # - src attribute in video element is sometimes null during ad playback
        # - many ads still don't use MSE even if main video does
        with self.marionette.using_context('content'):
            youtube = YouTubePuppeteer(self.marionette, url)
            youtube.attempt_ad_skip()
            wait = Wait(youtube,
                        timeout=min(self.max_timeout,
                                    youtube.player_duration * 1.3),
                        interval=1)

            def cond(y):
                return y.video_src.startswith(src_type)

            verbose_until(wait, youtube, cond)