OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved. |
3 * Copyright (C) 2011 Apple Inc. All rights reserved. | 3 * Copyright (C) 2011 Apple Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 797 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
808 | 808 |
809 if (!webFrame || !webFrame->client()) | 809 if (!webFrame || !webFrame->client()) |
810 return nullptr; | 810 return nullptr; |
811 | 811 |
812 WebMediaSession* webMediaSession = nullptr; | 812 WebMediaSession* webMediaSession = nullptr; |
813 if (MediaSession* mediaSession = HTMLMediaElementMediaSession::session(htmlM ediaElement)) | 813 if (MediaSession* mediaSession = HTMLMediaElementMediaSession::session(htmlM ediaElement)) |
814 webMediaSession = mediaSession->getWebMediaSession(); | 814 webMediaSession = mediaSession->getWebMediaSession(); |
815 | 815 |
816 HTMLMediaElementEncryptedMedia& encryptedMedia = HTMLMediaElementEncryptedMe dia::from(htmlMediaElement); | 816 HTMLMediaElementEncryptedMedia& encryptedMedia = HTMLMediaElementEncryptedMe dia::from(htmlMediaElement); |
817 WebString sinkId(HTMLMediaElementAudioOutputDevice::sinkId(htmlMediaElement) ); | 817 WebString sinkId(HTMLMediaElementAudioOutputDevice::sinkId(htmlMediaElement) ); |
818 return wrapUnique(webFrame->client()->createMediaPlayer(source, | 818 std::unique_ptr<WebMediaPlayer> mediaPlayer = wrapUnique(webFrame->client()- >createMediaPlayer(source, |
819 client, &encryptedMedia, | 819 client, &encryptedMedia, |
820 encryptedMedia.contentDecryptionModule(), sinkId, webMediaSession)); | 820 encryptedMedia.contentDecryptionModule(), sinkId, webMediaSession)); |
821 | |
822 // Check if video is in fullscreen playing back. | |
823 if (Fullscreen::isActiveFullScreenElement(htmlMediaElement)) { | |
824 mediaPlayer->videoEnteredFullscreen(); | |
825 } else if (htmlMediaElement.isParentInFullscreen()) { | |
826 Document& document = htmlMediaElement.document(); | |
827 if ((htmlMediaElement.clientWidth() >= document.domWindow()->innerWidth( )) && (htmlMediaElement.clientHeight() >= document.domWindow()->innerHeight())) | |
liberato (no reviews please)
2016/08/29 16:49:12
please consolidate this check with the one in HTML
xjz
2016/09/09 23:13:06
Done.
| |
828 mediaPlayer->videoEnteredFullscreen(); | |
829 } | |
830 return mediaPlayer; | |
821 } | 831 } |
822 | 832 |
823 std::unique_ptr<WebMediaSession> FrameLoaderClientImpl::createWebMediaSession() | 833 std::unique_ptr<WebMediaSession> FrameLoaderClientImpl::createWebMediaSession() |
824 { | 834 { |
825 if (!m_webFrame->client()) | 835 if (!m_webFrame->client()) |
826 return nullptr; | 836 return nullptr; |
827 | 837 |
828 return wrapUnique(m_webFrame->client()->createMediaSession()); | 838 return wrapUnique(m_webFrame->client()->createMediaSession()); |
829 } | 839 } |
830 | 840 |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1029 return m_webFrame->client()->getEffectiveConnectionType(); | 1039 return m_webFrame->client()->getEffectiveConnectionType(); |
1030 return WebEffectiveConnectionType::TypeUnknown; | 1040 return WebEffectiveConnectionType::TypeUnknown; |
1031 } | 1041 } |
1032 | 1042 |
1033 WebDevToolsAgentImpl* FrameLoaderClientImpl::devToolsAgent() | 1043 WebDevToolsAgentImpl* FrameLoaderClientImpl::devToolsAgent() |
1034 { | 1044 { |
1035 return WebLocalFrameImpl::fromFrame(m_webFrame->frame()->localFrameRoot())-> devToolsAgentImpl(); | 1045 return WebLocalFrameImpl::fromFrame(m_webFrame->frame()->localFrameRoot())-> devToolsAgentImpl(); |
1036 } | 1046 } |
1037 | 1047 |
1038 } // namespace blink | 1048 } // namespace blink |
OLD | NEW |