2016-05-24 13 views
1

TextViewにhtmlコンテンツの動画を表示できますか?でAndroidのビデオリンクは、html.imageGetterを使用して画像を表示するような形で表示されます。

<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> 

:、私のTexviewの一つでHTMLコンテンツを表示していますが

私のHTMLコンテンツは、このようなものです、道具をHtml.ImageGetter実装することにより、画像を表示するが、ビデオの表示についてアイデアを持っているdoes'tていますコンテンツの終わり私は表示することができないiframeのビデオを持っている、我々はアンドロイドでこれを達成することができますか? お勧めします。

答えて

1

我々はTextViewの

内のHTMLコンテンツからビデオを表示することができません、申し訳ありませんが、TextViewは、ビデオを表示する機能を持っていません。

私たちはこれをアンドロイドで達成できますか?

WebViewを使用してください。

+0

おかげで、私は、このシナリオでのWebViewを使用することはできません。

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

また、ここpostet。 –

+1

@SajadBinNazir:あなたはそのHTMLをそのまま使用する手段がありません。そのHTMLを自分で解析し、動画を表示するために何か他のもの(例えば、 'VideoView')を使用することは大歓迎です。 – CommonsWare

1

iframeからリンクを張ることもできます。答えを TagHandler to handle Youtube tag ?

+0

これは単なるビデオのためにwebviewを使うのではなく、アンドロイドのコンテンツとして保存したい場合に便利な考えです。 –

関連する問題