gpt4 book ai didi

Android视频链接在android textview中显示就像我们使用html.imageGetter显示图像一样

转载 作者:搜寻专家 更新时间:2023-11-01 08:35:03 26 4
gpt4 key购买 nike

我们可以在 TextView 中显示来自 html 内容的视频吗?我在我的 Texview 之一中显示 html 内容,我通过实现实现 Html.ImageGetter 来显示图像,但对显示视频一无所知,

我的 Html 内容是这样的:

    <p>Police today baton charged hundreds of daily wagers working in                   various government departments during a protest here in which they were demanding regularisation of service.</p>
<p>The workers assembled at Sher-e-Kashmir Park and started marching towards Lal Chowk area of the city raising slogans in favour of their demands, a police official said.</p>
<p>He said as soon as the protesters crossed the Polo View crossing, police intercepted them and asked the protesters to disperse peacefully.</p>
<p>However, they refused to pay any heed and tried to march ahead.</p>
<p>The police used batons to disperse the protesters and took over 30 of them into preventive custody, the official said.</p>
<p>No one was injured in the police action, he added.</p>
<p><iframe width="480" height="315" src="http video link url" frameborder="0" allowfullscreen=""> </iframe></p>

在内容的末尾,我在 iframe 中有我无法播放的视频,我们可以在 android 中实现吗?请提出建议。

最佳答案

您也可以从 iframe 建立链接。

htmlString.replaceAll("<iframe\\s+.*?\\s+src=(\".*?\").*?<\\/iframe>", "<a href=$1>CLICK TO WATCH</a>");

也在这里发布: TagHandler to handle Youtube tag ?

关于Android视频链接在android textview中显示就像我们使用html.imageGetter显示图像一样,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37421528/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com