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 681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
692 client_->didBlockPlaybackWaitingForKey(); | 692 client_->didBlockPlaybackWaitingForKey(); |
693 | 693 |
694 // TODO(jrummell): didResumePlaybackBlockedForKey() should only be called | 694 // TODO(jrummell): didResumePlaybackBlockedForKey() should only be called |
695 // when a key has been successfully added (e.g. OnSessionKeysChange() with | 695 // when a key has been successfully added (e.g. OnSessionKeysChange() with |
696 // |has_additional_usable_key| = true). http://crbug.com/461903 | 696 // |has_additional_usable_key| = true). http://crbug.com/461903 |
697 client_->didResumePlaybackBlockedForKey(); | 697 client_->didResumePlaybackBlockedForKey(); |
698 } | 698 } |
699 | 699 |
700 void WebMediaPlayerImpl::SetCdm(const CdmAttachedCB& cdm_attached_cb, | 700 void WebMediaPlayerImpl::SetCdm(const CdmAttachedCB& cdm_attached_cb, |
701 CdmContext* cdm_context) { | 701 CdmContext* cdm_context) { |
702 pipeline_.SetCdm(cdm_context, cdm_attached_cb); | 702 // The CDM may fail to create, so no need to tell the pipeline that a CDM |
ddorwin
2015/05/04 22:46:02
nit: // If CDM initialization failed, there is no
jrummell
2015/05/05 00:54:17
Done.
| |
703 // is attached. | |
704 if (cdm_context) | |
705 pipeline_.SetCdm(cdm_context, cdm_attached_cb); | |
703 } | 706 } |
704 | 707 |
705 void WebMediaPlayerImpl::OnCdmAttached( | 708 void WebMediaPlayerImpl::OnCdmAttached( |
706 blink::WebContentDecryptionModuleResult result, | 709 blink::WebContentDecryptionModuleResult result, |
707 bool success) { | 710 bool success) { |
708 if (success) { | 711 if (success) { |
709 result.complete(); | 712 result.complete(); |
710 return; | 713 return; |
711 } | 714 } |
712 | 715 |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1013 | 1016 |
1014 // pause() may be called after playback has ended and the HTMLMediaElement | 1017 // pause() may be called after playback has ended and the HTMLMediaElement |
1015 // requires that currentTime() == duration() after ending. We want to ensure | 1018 // requires that currentTime() == duration() after ending. We want to ensure |
1016 // |paused_time_| matches currentTime() in this case or a future seek() may | 1019 // |paused_time_| matches currentTime() in this case or a future seek() may |
1017 // incorrectly discard what it thinks is a seek to the existing time. | 1020 // incorrectly discard what it thinks is a seek to the existing time. |
1018 paused_time_ = | 1021 paused_time_ = |
1019 ended_ ? pipeline_.GetMediaDuration() : pipeline_.GetMediaTime(); | 1022 ended_ ? pipeline_.GetMediaDuration() : pipeline_.GetMediaTime(); |
1020 } | 1023 } |
1021 | 1024 |
1022 } // namespace media | 1025 } // namespace media |
OLD | NEW |