haikuwebkit/ManualTests/wpe/video-player-holepunch-exte...

57 lines
1.9 KiB
HTML
Raw Permalink Normal View History

[WPE] Add support for holepunch using an external video player https://bugs.webkit.org/show_bug.cgi?id=194899 Reviewed by Xabier Rodriguez-Calvar. .: Add EXTERNAL_HOLEPUNCH option to the WPE port. Add a manual test to check the feature. Rename and update the test for GStreamer holepunch to avoid confusion. * ManualTests/wpe/video-player-holepunch-external.html: Added. * ManualTests/wpe/video-player-holepunch-gstreamer.html: Renamed from ManualTests/wpe/video-player-holepunch.html. * Source/cmake/OptionsWPE.cmake: Source/WebCore: Implement the holepunch feature to allow playback using an external player. This creates a new dummy MediaPlayerPrivateHolePunch that accepts only the type "video/holepunch", and whose goal is to just draw a transparent rectangle in the position where the video should be. This can be used to allow a player placed on a lower plane than the browser to become visible. Added ManualTest wpe/video-player-holepunch-external.html to test the feature. * PlatformWPE.cmake: * platform/HolePunch.cmake: Added. * platform/graphics/MediaPlayer.cpp: (WebCore::buildMediaEnginesVector): * platform/graphics/holepunch/MediaPlayerPrivateHolePunch.cpp: Added. (WebCore::MediaPlayerPrivateHolePunch::MediaPlayerPrivateHolePunch): (WebCore::MediaPlayerPrivateHolePunch::~MediaPlayerPrivateHolePunch): (WebCore::MediaPlayerPrivateHolePunch::platformLayer const): (WebCore::MediaPlayerPrivateHolePunch::naturalSize const): (WebCore::MediaPlayerPrivateHolePunch::pushNextHolePunchBuffer): (WebCore::MediaPlayerPrivateHolePunch::swapBuffersIfNeeded): (WebCore::MediaPlayerPrivateHolePunch::proxy const): (WebCore::mimeTypeCache): (WebCore::MediaPlayerPrivateHolePunch::getSupportedTypes): (WebCore::MediaPlayerPrivateHolePunch::supportsType): (WebCore::MediaPlayerPrivateHolePunch::registerMediaEngine): (WebCore::MediaPlayerPrivateHolePunch::notifyReadyState): * platform/graphics/holepunch/MediaPlayerPrivateHolePunch.h: Added. * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp: (WebCore::TextureMapperPlatformLayerBuffer::paintToTextureMapper): Canonical link: https://commits.webkit.org/209357@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242033 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-02-25 09:20:01 +00:00
<html>
<head>
<title>WPE external holepunch test</title>
<style>
video {
width: 400px;
height: 400px;
}
</style>
</head>
<body>
<p>
<strong>WPE external holepunch test</strong>
</p>
<p>
This test checks whether the external holepunch feature is working on WPE.
</p>
<p>
There is a video player of 400x400 below this text. It will play a valid video for 5 seconds, then a holepunch one
for another 5 seconds and then the first one again.
</p>
<p>
If everything is working fine, there should be the valid video for 5 seconds, then a transparent rectangle of 400x400
for 5 seconds, and then again the valid video.
</p>
<p>
If GStreamer holepunch is enabled when running this test, the first and third video will show a transparent
rectangle instead of the video content.
</p>
<video id="video">
<source id="source" src="../../LayoutTests/media/content/long-test.mp4" type="video/mp4">
</video>
<div id="log"></div>
<script type="text/javascript">
var v = document.getElementById("video");
var s = document.getElementById("source");
var l = document.getElementById("log");
log.innerHTML = "Playing first video. The video (or a transparent rectangle if GStreamer holepunch is enabled) should be visible";
v.play();
setTimeout(function() {
s.type = "video/holepunch";
v.load();
v.play();
log.innerHTML = "Playing second video. A transparent rectangle should be visible";
}, 5000);
setTimeout(function() {
s.type = "video/mp4";
v.load();
v.play();
log.innerHTML = "Playing third video. The video (or a transparent rectangle if GStreamer holepunch is enabled) should be visible";
}, 10000);
</script>
</body>
</html>