我们可以在 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>");
关于Android 视频链接显示在 android textview 中,就像我们使用 html.imageGetter 显示图像一样,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37421528/