OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
501 if (!remoting_interstitial_) { | 501 if (!remoting_interstitial_) { |
502 remoting_interstitial_ = new MediaRemotingInterstitial(*this); | 502 remoting_interstitial_ = new MediaRemotingInterstitial(*this); |
503 ShadowRoot& shadow_root = EnsureUserAgentShadowRoot(); | 503 ShadowRoot& shadow_root = EnsureUserAgentShadowRoot(); |
504 shadow_root.InsertBefore(remoting_interstitial_, shadow_root.firstChild()); | 504 shadow_root.InsertBefore(remoting_interstitial_, shadow_root.firstChild()); |
505 HTMLMediaElement::AssertShadowRootChildren(shadow_root); | 505 HTMLMediaElement::AssertShadowRootChildren(shadow_root); |
506 } | 506 } |
507 remoting_interstitial_->Show(); | 507 remoting_interstitial_->Show(); |
508 } | 508 } |
509 | 509 |
510 void HTMLVideoElement::MediaRemotingStopped() { | 510 void HTMLVideoElement::MediaRemotingStopped() { |
511 // Early return because this was already called when media remoting was | 511 DCHECK(media_remoting_status_ == MediaRemotingStatus::kDisabled || |
512 // disabled. | 512 media_remoting_status_ == MediaRemotingStatus::kStarted); |
513 if (media_remoting_status_ == MediaRemotingStatus::kDisabled) | 513 if (media_remoting_status_ != MediaRemotingStatus::kDisabled) |
514 return; | 514 media_remoting_status_ = MediaRemotingStatus::kNotStarted; |
515 DCHECK(media_remoting_status_ == MediaRemotingStatus::kStarted); | |
516 DCHECK(remoting_interstitial_); | 515 DCHECK(remoting_interstitial_); |
517 media_remoting_status_ = MediaRemotingStatus::kNotStarted; | |
518 remoting_interstitial_->Hide(); | 516 remoting_interstitial_->Hide(); |
519 } | 517 } |
520 | 518 |
521 void HTMLVideoElement::DisableMediaRemoting() { | 519 void HTMLVideoElement::DisableMediaRemoting() { |
| 520 media_remoting_status_ = MediaRemotingStatus::kDisabled; |
522 if (GetWebMediaPlayer()) | 521 if (GetWebMediaPlayer()) |
523 GetWebMediaPlayer()->RequestRemotePlaybackDisabled(true); | 522 GetWebMediaPlayer()->RequestRemotePlaybackDisabled(true); |
524 media_remoting_status_ = MediaRemotingStatus::kDisabled; | |
525 MediaRemotingStopped(); | |
526 } | 523 } |
527 | 524 |
528 } // namespace blink | 525 } // namespace blink |
OLD | NEW |