Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(134)

Side by Side Diff: media/blink/webmediaplayer_impl.h

Issue 2567833002: [Video] Pause videos with no audio when in the background. (Closed)
Patch Set: Rebase Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | media/blink/webmediaplayer_impl.cc » ('j') | media/blink/webmediaplayer_impl.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MEDIA_BLINK_WEBMEDIAPLAYER_IMPL_H_ 5 #ifndef MEDIA_BLINK_WEBMEDIAPLAYER_IMPL_H_
6 #define MEDIA_BLINK_WEBMEDIAPLAYER_IMPL_H_ 6 #define MEDIA_BLINK_WEBMEDIAPLAYER_IMPL_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 361
362 void CreateWatchTimeReporter(); 362 void CreateWatchTimeReporter();
363 363
364 // Returns true if the player is hidden. 364 // Returns true if the player is hidden.
365 bool IsHidden() const; 365 bool IsHidden() const;
366 366
367 // Return whether |pipeline_metadata_| is compatible with an overlay. This 367 // Return whether |pipeline_metadata_| is compatible with an overlay. This
368 // is intended for android. 368 // is intended for android.
369 bool DoesOverlaySupportMetadata() const; 369 bool DoesOverlaySupportMetadata() const;
370 370
371 // Whether the media should be paused when hidden.
372 bool ShouldPauseWhenHidden() const;
373
371 blink::WebLocalFrame* frame_; 374 blink::WebLocalFrame* frame_;
372 375
373 // The playback state last reported to |delegate_|, to avoid setting duplicate 376 // The playback state last reported to |delegate_|, to avoid setting duplicate
374 // states. (Which can have undesired effects like resetting the idle timer.) 377 // states. (Which can have undesired effects like resetting the idle timer.)
375 DelegateState delegate_state_; 378 DelegateState delegate_state_;
376 379
377 // Set when OnSuspendRequested() is called with |must_suspend| unset. 380 // Set when OnSuspendRequested() is called with |must_suspend| unset.
378 bool is_idle_; 381 bool is_idle_;
379 382
380 // Set when OnSuspendRequested() is called with |must_suspend| set. 383 // Set when OnSuspendRequested() is called with |must_suspend| set.
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 // to hang the render thread during pause(), we record the time at the same 427 // to hang the render thread during pause(), we record the time at the same
425 // time we pause and then return that value in currentTime(). Otherwise our 428 // time we pause and then return that value in currentTime(). Otherwise our
426 // clock can creep forward a little bit while the asynchronous 429 // clock can creep forward a little bit while the asynchronous
427 // SetPlaybackRate(0) is being executed. 430 // SetPlaybackRate(0) is being executed.
428 double playback_rate_; 431 double playback_rate_;
429 432
430 // Set while paused. |paused_time_| is only valid when |paused_| is true. 433 // Set while paused. |paused_time_| is only valid when |paused_| is true.
431 bool paused_; 434 bool paused_;
432 base::TimeDelta paused_time_; 435 base::TimeDelta paused_time_;
433 436
437 // Set if paused automatically when hidden and need to resume when visible.
438 // Reset if paused for any other reason.
439 bool paused_when_hidden_;
440
434 // Set when starting, seeking, and resuming (all of which require a Pipeline 441 // Set when starting, seeking, and resuming (all of which require a Pipeline
435 // seek). |seek_time_| is only valid when |seeking_| is true. 442 // seek). |seek_time_| is only valid when |seeking_| is true.
436 bool seeking_; 443 bool seeking_;
437 base::TimeDelta seek_time_; 444 base::TimeDelta seek_time_;
438 445
439 // Set when doing a restart (a suspend and resume in sequence) of the pipeline 446 // Set when doing a restart (a suspend and resume in sequence) of the pipeline
440 // in order to destruct and reinitialize the decoders. This is separate from 447 // in order to destruct and reinitialize the decoders. This is separate from
441 // |pending_resume_| and |pending_suspend_| because they can be elided in 448 // |pending_resume_| and |pending_suspend_| because they can be elided in
442 // certain cases, whereas for a restart they must happen. 449 // certain cases, whereas for a restart they must happen.
443 // TODO(sandersd,watk): Create a simpler interface for a pipeline restart. 450 // TODO(sandersd,watk): Create a simpler interface for a pipeline restart.
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
591 598
592 // Whether the player is currently in autoplay muted state. 599 // Whether the player is currently in autoplay muted state.
593 bool autoplay_muted_ = false; 600 bool autoplay_muted_ = false;
594 601
595 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); 602 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl);
596 }; 603 };
597 604
598 } // namespace media 605 } // namespace media
599 606
600 #endif // MEDIA_BLINK_WEBMEDIAPLAYER_IMPL_H_ 607 #endif // MEDIA_BLINK_WEBMEDIAPLAYER_IMPL_H_
OLDNEW
« no previous file with comments | « no previous file | media/blink/webmediaplayer_impl.cc » ('j') | media/blink/webmediaplayer_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698