MDL-56829 media_videojs: play inline on iPhone with ios 10

This commit is contained in:
Marina Glancy 2016-11-29 13:02:31 +08:00
parent 3eabedbb92
commit 7d94f001e2

View file

@ -145,6 +145,15 @@ class media_videojs_plugin extends core_media_player_native {
$attributes += ['width' => $width] + ($height ? ['height' => $height] : []); $attributes += ['width' => $width] + ($height ? ['height' => $height] : []);
} }
if (core_useragent::is_ios(10)) {
// Hides native controls and plays videos inline instead of fullscreen,
// see https://github.com/videojs/video.js/issues/3761 and
// https://github.com/videojs/video.js/issues/3762 .
// iPhone with iOS 9 still displays double controls and plays fullscreen.
// iPhone with iOS before 9 display only native controls.
$attributes += ['playsinline' => 'true'];
}
if ($text !== null) { if ($text !== null) {
// Original text already had media tag - add necessary attributes and replace sources // Original text already had media tag - add necessary attributes and replace sources
// with the supported URLs only. // with the supported URLs only.