hdezela
unread,Mar 31, 2011, 1:47:33 PM3/31/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to phonegap
Here is my App.java:
package com.phonegap.orbem;
import android.content.pm.ActivityInfo;
import android.content.ActivityNotFoundException;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import android.webkit.DownloadListener;
import com.phonegap.*;
public class App extends DroidGap {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setRequestedOrientation (ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
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 intent = new Intent();
intent.setAction(android.content.Intent.ACTION_VIEW);
intent.setDataAndType(Uri.parse(url), "video/mp4");
try { startActivity(intent); }
catch (ActivityNotFoundException ex) { Log.w("VideoError: ",
"Couldn't find activity to view mimetype: " + mimeType); }
}
});
}
}
It works for RTMP, it goes straight to the video player, but when I
tray to play a video over HTTP...it goes to the browser...is my code
wrong or should ALL video be served through RTMP even if it is a
static file?