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 if (media_remoting_status_ != MediaRemotingStatus::kDisabled) |
512 // disabled. | 512 media_remoting_status_ = MediaRemotingStatus::kNotStarted; |
513 if (media_remoting_status_ == MediaRemotingStatus::kDisabled) | |
514 return; | |
515 DCHECK(media_remoting_status_ == MediaRemotingStatus::kStarted); | |
whywhat
2017/05/19 15:58:19
nit: could you leave a DCHECK that the status can
xjz
2017/05/22 21:56:03
Done.
| |
516 DCHECK(remoting_interstitial_); | 513 DCHECK(remoting_interstitial_); |
517 media_remoting_status_ = MediaRemotingStatus::kNotStarted; | |
518 remoting_interstitial_->Hide(); | 514 remoting_interstitial_->Hide(); |
519 } | 515 } |
520 | 516 |
521 void HTMLVideoElement::DisableMediaRemoting() { | 517 void HTMLVideoElement::DisableMediaRemoting() { |
522 if (GetWebMediaPlayer()) | 518 if (GetWebMediaPlayer()) |
523 GetWebMediaPlayer()->RequestRemotePlaybackDisabled(true); | 519 GetWebMediaPlayer()->RequestRemotePlaybackDisabled(true); |
524 media_remoting_status_ = MediaRemotingStatus::kDisabled; | 520 media_remoting_status_ = MediaRemotingStatus::kDisabled; |
whywhat
2017/05/19 15:58:19
Should this be set before requesting to disable re
xjz
2017/05/22 21:56:03
Done.
| |
525 MediaRemotingStopped(); | |
526 } | 521 } |
527 | 522 |
528 } // namespace blink | 523 } // namespace blink |
OLD | NEW |