1
我是新的android開發。我正在使用視頻標籤。但在模擬器上運行時,視頻不會播放。雖然視頻在瀏覽器上運行良好。有人能幫我解決我所缺失的問題嗎?<video>標籤不工作android模擬器
<video id="video" autoplay width="500" height="400" controls="controls">
<source src="http://ec2-50-16-201-31.compute-1.amazonaws.com/p/100/sp/10000/flvclipper/entry_id/0_hu1hm4qg" />
not working
<script type="text/javascript">
var video = document.getElementById('video');
video.addEventListener('click',function(){
video.play();
},false);
我使用的PhoneGap以及
。 Java代碼:App.java
public class App extends DroidGap {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
super.loadUrl("file:///android_asset/www/index.html");
appView.setDownloadListener(new DownloadListener() {
public void onDownloadStart(String url, String userAgent,
String contentDisposition, String mimeType, long size) {
Intent viewIntent = new Intent(Intent.ACTION_VIEW);
viewIntent.setDataAndType(Uri.parse(url), mimeType);
try {
startActivity(viewIntent);
} catch (ActivityNotFoundException ex) {
Log.w("YourLogTag",
"Couldn't find activity to view mimetype: "
+ mimeType);
}
}
});
}
}
有沒有人遇到類似的問題。我在網上搜索了很多,但無法縮小問題的範圍。 我正在使用android 3.2和phonegap 1.0.0 – Hozefa
你如何顯示它?在您自己的一個應用程序中的WebView中?或者在模擬器上安裝的股票瀏覽器中?你嘗試過一個真實的設備嗎? – FoamyGuy
@Tim:我試圖在我自己的應用程序中的WebView中顯示。我目前正在使用模擬器,尚未在設備上嘗試過。 – Hozefa