Starting youtube playback from current playback quality
As we're unable to change youtbe resolution from high to low,
using current running video resolution as a starting quality.
Commit-Ready: Avinash Kodipelli <email@example.com>
Tested-by: Avinash Kodipelli <firstname.lastname@example.org>
Reviewed-by: Kuang-che Wu <email@example.com>
diff --git a/client/cros/video/youtube_helper.py b/client/cros/video/youtube_helper.py
index d0f6729..f160c67 100644
@@ -150,30 +150,26 @@
'Player failed to return available video qualities.')
- # Removing 'auto' resolution since it tends to interfere with explicit
- # bandwidth selection later.
+ running_quality = self.get_playback_quality()
+ index = video_qualities.index(running_quality)
+ supporting_qualities = video_qualities[index :]
+ logging.info("new video quality %s ", supporting_qualities)
width, height = graphics_utils.get_internal_resolution()
logging.info('checking resolution: %d width %d height', width, height)
- for quality in video_qualities:
+ for quality in supporting_qualities:
logging.info('Playing video in %s quality.', quality)
current_quality = self.get_playback_quality()
- if (quality not in ['auto', 'tiny', 'small'] and
- quality != current_quality):
- if current_quality in ['hd720', 'hd1080'] and width == 2560:
- logging.info('HD devices starts playing YouTube video in '
- 'HD so skipping 480p test.')
- raise error.TestError(
- 'Expected video quality: %s. Current video quality: %s'
- % (quality, current_quality))
+ if current_quality != quality :
+ raise error.TestError(
+ 'Expected video quality: %s. Current video quality: %s'
+ % (quality, current_quality))
- # setting the video resolution to 480p for rest of the tests.