• hugo.holgersson's avatar
    Tear down ContentVideoView from content-layer · 61288e6c
    hugo.holgersson authored
    Background: ContentVideoView displays fullscreen video in a
    VideoViewSurface. Currently, each Android content embedder
    (WebView, ContentShell, and ChromeShell) is responsible for
    releasing this surface when exiting fullscreen.
    
    Problem: Releasing ContentVideoView from each embedder leads to
    code duplication. Worse, this was never done for the WebView:
    when it exits fullscreen video playback, AwContents's
    exitFullScreen removes the VideoViewSurface which triggers
    ContentVideoView's surfaceDestroyed(). surfaceDestroyed()
    releases the MediaPlayerAndroid. Releasing the MediaPlayerAndroid
    during playback gives a frozen video (see bug).
    
    Solution: For all content embedders on Android, tear down
    ContentVideoView, from content-layer (before the embedder
    specific "exit fullscreen"-work).
    
    BUG=449152
    TEST=For unencrypted video, manually verify that video playback
    continues inline when exiting fullscreen (tested in
    com.android.browser, ContentShell and ChromeShell). Added
    automatic test for VIDEO_HOLE-playback in WebView.
    
    Review URL: https://codereview.chromium.org/845193005
    
    Cr-Commit-Position: refs/heads/master@{#313531}
    61288e6c
web_contents_impl.cc 156 KB