Yauheni Aliashkevich Yauheni Aliashkevich - 1 year ago 219
iOS Question

IOS9 WKWebView html5 video no playback button

I'm using WKWebView to display html5 video element. When view is loaded initially there is play button (big round button). If you press it built-in video fullscreen controller is displayed and video starts playing.

While video is playing press "Done" button:

1. fullscreen controller collapses and I see my webview

2. but there is no play button anymore (so I can't start playing video again)

If you first pause video and that press "Done", or watch video to the end and then press "Done" everything is fine.

Works on IOS8 without issues.

Is it IOS9 bug, or I have something configured wrong?
What workarounds are possible?

Here is html that is loaded into webview:

@"<!DOCTYPE html>
<meta name=""viewport"" content=""width=device-width, initial-scale=1, user-scalable=no"">
html, body {{
margin: 0;
padding: 0;
background-color: #000;
video {{
background-color: #000;
width: 100%;
height: auto;
max-height: 100%;
margin: auto;
top: 0;
left: 0;
bottom: 0;
right: 0;
position: absolute;
<video poster=""{0}""><source src=""{1}"" /></video>

Answer Source

The problem was missed controls attribute.

From Apple documentation:

The HTML5 and tags make it simple to add media to your website. Just include the or element, use the src attribute to identify the media source, and include the controls attribute.


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download