Webview 视频全屏 [英] Webview Video fullscreen

查看:47
本文介绍了Webview 视频全屏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用网络视图在我的应用中加载 YouTube 视频.但是全屏选项不起作用.我怎样才能实现全屏.

I am loading a YouTube video in my app using web-view. But the full screen option is not working. How can i achieve the full screen.

我的代码

<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:d="http://xamarin.com/schemas/2014/forms/design"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             mc:Ignorable="d"
             x:Class="Player.MainPage">

    <StackLayout>
        <Label Text="Hello"/>
        <WebView x:Name="browser" Source="https://www.youtube.com/watch?v=fDrTbLXHKu8" HeightRequest="500"/>
    </StackLayout>
</ContentPage>

截图

youtube 全屏无法正常工作.

The youtube fullscreen is not working.

推荐答案

您需要为 WebView 自定义渲染器.此 repo 将为您提供帮助.
可以在此处此处.

You need a custom renderer for your WebView. This repo will help you.
More details about this issue can be found here and here.

刚刚用这个 WebView 渲染器检查了你的代码,它在点击展开控件后显示全屏视频.

Just checked your code with this WebView renderer and it's showing fullscreen video after tapping expand control.

这篇关于Webview 视频全屏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆