我想使用Html.FromHTML()在android textview中显示嵌入URL。
我正在获取此JSON字符串
"<!DOCTYPE html>\r\n<html>\r\n<head>\r\n</head>\r\n<body>\r\n<p style=\"text-align: justify;\"><span data-sheets-value=\"{"1":2,"2":"This video is about hip hop dance done by Amit. He moved his leg from one of the A R Rahman album which Humma Humma song. The steps are too awesome which made you to shake your legs. Watch this to start shake your legs."}\" data-sheets-userformat=\"{"2":7043,"3":{"1":0},"4":{"1":2,"2":16777215},"10":0,"11":4,"12":0,"14":{"1":2,"2":3355443},"15":"\\"Arial\\",\\"sans-serif\\""}\">This video is about hip hop dance done by Amit. He moved his leg from one of the A R Rahman album which Humma Humma song. The steps are too awesome which made you to shake your legs. Watch this to start shake your legs.</span></p>\r\n<p style=\"text-align: justify;\"><span data-sheets-value=\"{"1":2,"2":"This video is about hip hop dance done by Amit. He moved his leg from one of the A R Rahman album which Humma Humma song. The steps are too awesome which made you to shake your legs. Watch this to start shake your legs."}\" data-sheets-userformat=\"{"2":7043,"3":{"1":0},"4":{"1":2,"2":16777215},"10":0,"11":4,"12":0,"14":{"1":2,"2":3355443},"15":"\\"Arial\\",\\"sans-serif\\""}\">
<iframe src=\"//www.youtube.com/embed/mhIDO6YMx80\" width=\"560\" height=\"314\" allowfullscreen=\"allowfullscreen\"></iframe></span></p>\r\n</body>\r\n</html>"
我在TextView
中使用Html.FromHTML()显示此内容。在此我知道{H} .FromHTML()中不支持<iframe src>
标记。而不是这个我怎么能显示视频。在JSON HTML String中,它将成像&amp;文字&amp;视频和所有。
请任何人有想法,分享。在此先感谢。
答案 0 :(得分:2)
你不能。我想在android textview中使用显示嵌入URL Html.FromHTML()。
Html.FromHtml()
无法解析/处理iframe
而不是这个我如何显示视频
您必须使用WebView
,或者您可以使用YouTube sdk
及其所有限制