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 1456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1467 if (!video_weblayer_) | 1467 if (!video_weblayer_) |
1468 return pipeline_metadata_.natural_size; | 1468 return pipeline_metadata_.natural_size; |
1469 | 1469 |
1470 return video_weblayer_->bounds(); | 1470 return video_weblayer_->bounds(); |
1471 } | 1471 } |
1472 | 1472 |
1473 void WebMediaPlayerImpl::SetDeviceScaleFactor(float scale_factor) { | 1473 void WebMediaPlayerImpl::SetDeviceScaleFactor(float scale_factor) { |
1474 cast_impl_.SetDeviceScaleFactor(scale_factor); | 1474 cast_impl_.SetDeviceScaleFactor(scale_factor); |
1475 } | 1475 } |
1476 | 1476 |
1477 void WebMediaPlayerImpl::setPoster(const blink::WebURL& poster) { | |
1478 cast_impl_.setPoster(poster); | |
1479 } | |
1480 | |
1481 void WebMediaPlayerImpl::SetUseFallbackPath(bool use_fallback_path) { | 1477 void WebMediaPlayerImpl::SetUseFallbackPath(bool use_fallback_path) { |
1482 use_fallback_path_ = use_fallback_path; | 1478 use_fallback_path_ = use_fallback_path; |
1483 } | 1479 } |
1484 #endif // defined(OS_ANDROID) // WMPI_CAST | 1480 #endif // defined(OS_ANDROID) // WMPI_CAST |
1485 | 1481 |
| 1482 void WebMediaPlayerImpl::setPoster(const blink::WebURL& poster) { |
| 1483 #if defined(OS_ANDROID) |
| 1484 cast_impl_.setPoster(poster); |
| 1485 #endif |
| 1486 |
| 1487 if (observer_) |
| 1488 observer_->OnSetPoster(poster); |
| 1489 } |
| 1490 |
1486 void WebMediaPlayerImpl::DataSourceInitialized(bool success) { | 1491 void WebMediaPlayerImpl::DataSourceInitialized(bool success) { |
1487 DVLOG(1) << __func__; | 1492 DVLOG(1) << __func__; |
1488 DCHECK(main_task_runner_->BelongsToCurrentThread()); | 1493 DCHECK(main_task_runner_->BelongsToCurrentThread()); |
1489 | 1494 |
1490 #if defined(OS_ANDROID) | 1495 #if defined(OS_ANDROID) |
1491 // We can't play HLS URLs with WebMediaPlayerImpl, so in cases where they are | 1496 // We can't play HLS URLs with WebMediaPlayerImpl, so in cases where they are |
1492 // encountered, instruct the HTML media element to create a new WebMediaPlayer | 1497 // encountered, instruct the HTML media element to create a new WebMediaPlayer |
1493 // instance with the correct URL to trigger WebMediaPlayerAndroid creation. | 1498 // instance with the correct URL to trigger WebMediaPlayerAndroid creation. |
1494 // | 1499 // |
1495 // TODO(tguilbert): Remove this code path once we have the ability to host a | 1500 // TODO(tguilbert): Remove this code path once we have the ability to host a |
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2011 return delegate_ && delegate_->IsHidden(); | 2016 return delegate_ && delegate_->IsHidden(); |
2012 } | 2017 } |
2013 | 2018 |
2014 void WebMediaPlayerImpl::ActivateViewportIntersectionMonitoring(bool activate) { | 2019 void WebMediaPlayerImpl::ActivateViewportIntersectionMonitoring(bool activate) { |
2015 DCHECK(main_task_runner_->BelongsToCurrentThread()); | 2020 DCHECK(main_task_runner_->BelongsToCurrentThread()); |
2016 | 2021 |
2017 client_->activateViewportIntersectionMonitoring(activate); | 2022 client_->activateViewportIntersectionMonitoring(activate); |
2018 } | 2023 } |
2019 | 2024 |
2020 } // namespace media | 2025 } // namespace media |
OLD | NEW |