| OLD | NEW |
| 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 #include "media/blink/webmediaplayer_impl.h" | 5 #include "media/blink/webmediaplayer_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <limits> | 9 #include <limits> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 845 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 856 | 856 |
| 857 set_cdm_result_->completeWithError( | 857 set_cdm_result_->completeWithError( |
| 858 blink::WebContentDecryptionModuleExceptionNotSupportedError, 0, | 858 blink::WebContentDecryptionModuleExceptionNotSupportedError, 0, |
| 859 "Unable to set MediaKeys object"); | 859 "Unable to set MediaKeys object"); |
| 860 set_cdm_result_.reset(); | 860 set_cdm_result_.reset(); |
| 861 } | 861 } |
| 862 | 862 |
| 863 void WebMediaPlayerImpl::OnPipelineSeeked(bool time_updated) { | 863 void WebMediaPlayerImpl::OnPipelineSeeked(bool time_updated) { |
| 864 seeking_ = false; | 864 seeking_ = false; |
| 865 seek_time_ = base::TimeDelta(); | 865 seek_time_ = base::TimeDelta(); |
| 866 if (paused_) | 866 if (paused_) { |
| 867 #if defined(OS_ANDROID) // WMPI_CAST |
| 868 if (isRemote()) { |
| 869 paused_time_ = base::TimeDelta::FromSecondsD(cast_impl_.currentTime()); |
| 870 } else { |
| 871 paused_time_ = pipeline_.GetMediaTime(); |
| 872 } |
| 873 #else |
| 867 paused_time_ = pipeline_.GetMediaTime(); | 874 paused_time_ = pipeline_.GetMediaTime(); |
| 875 #endif |
| 876 } |
| 868 if (time_updated) | 877 if (time_updated) |
| 869 should_notify_time_changed_ = true; | 878 should_notify_time_changed_ = true; |
| 870 } | 879 } |
| 871 | 880 |
| 872 void WebMediaPlayerImpl::OnPipelineSuspended() { | 881 void WebMediaPlayerImpl::OnPipelineSuspended() { |
| 873 #if defined(OS_ANDROID) | 882 #if defined(OS_ANDROID) |
| 874 if (isRemote()) { | 883 if (isRemote()) { |
| 875 scoped_refptr<VideoFrame> frame = cast_impl_.GetCastingBanner(); | 884 scoped_refptr<VideoFrame> frame = cast_impl_.GetCastingBanner(); |
| 876 if (frame) { | 885 if (frame) { |
| 877 compositor_->PaintFrameUsingOldRenderingPath(frame); | 886 compositor_->PaintFrameUsingOldRenderingPath(frame); |
| (...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1483 bool WebMediaPlayerImpl::IsAutomaticResumeAllowed() { | 1492 bool WebMediaPlayerImpl::IsAutomaticResumeAllowed() { |
| 1484 #if defined(OS_ANDROID) | 1493 #if defined(OS_ANDROID) |
| 1485 return !hasVideo() || (delegate_ && !delegate_->IsHidden()); | 1494 return !hasVideo() || (delegate_ && !delegate_->IsHidden()); |
| 1486 #else | 1495 #else |
| 1487 // On non-Android platforms Resume() is always allowed. | 1496 // On non-Android platforms Resume() is always allowed. |
| 1488 return true; | 1497 return true; |
| 1489 #endif | 1498 #endif |
| 1490 } | 1499 } |
| 1491 | 1500 |
| 1492 } // namespace media | 1501 } // namespace media |
| OLD | NEW |