2011-07-01 38 views
5

Tôi đang sử dụng dữ liệu sau để hiển thị trong một WebView. Đây là các thẻ HTML cùng với khung nội tuyến đề cập đến video.Không thể phát video bên trong WebView bằng thẻ iframe?

Bây giờ vấn đề là khi tôi nhấp vào nó, nó sẽ hiển thị nút phát nhưng không thể phát video.

Tôi có thể phát video này bên trong WebView hay không?

<p></p><P> because of Jon’s pro-growth, business-friendly policies, Utah's economy expanded at more than triple the national rate and was named the best state for business by <EM>Forbes.</em><BR /><BR /><IFRAME height=241 src="http://player.vimeo.com/video/25349114" frameBorder=0 width=425></iframe></p><br /> 

<P>America needs a dose of the same medicine. Today, our nation has the second highest corporate tax rate in the developed world. We have convoluted and confusing regulations. 
<!--break--><!--break--><p></p> 

khi tôi cố gắng chạy url này trong trình duyệt Android, nó sẽ mở videoview và phát tệp đó hoàn hảo nhưng tại sao không trong iframe? http://player.vimeo.com/video/25349114

+0

phương pháp nào bạn đang sử dụng để tải chuỗi này trong webview? – dhuma1981

Trả lời

3

Điều quan trọng là cho phép plugin trình duyệt.

// how to enable the webview plugin changed in API 8 
if (Build.VERSION.SDK_INT < 8) { 
    mWebView.getSettings().setPluginsEnabled(true); 
} else { 
    mWebView.getSettings().setPluginState(PluginState.ON); 
} 

Ngoài ra giá trị kiểm tra flash player is installed

2
WebView wv; 
wv = (WebView) findViewById(R.id.mywebview); 

wv.getSettings().setJavaScriptEnabled(true); 
wv.getSettings().setBuiltInZoomControls(true); 
wv.getSettings().setPluginsEnabled(true); 

Sử dụng mã này để tải video của bạn và cũng có thể cập nhật các flashplayer của điện thoại ...

+0

Ye mà kinda hoạt động, chỉ trông crappy từ nơi tôi đang xem :) – Warpzit

Các vấn đề liên quan