How do I trigger the intention to run flv or swf for Flash Player 10.1?

I have a bunch of flv video files stored on a media server , and I'm trying to run them in a Flash player. We looked around, but did not find much help. I uploaded the FLV file to temporary storage and tried to transfer it using intent. This is what my code looks like (from what I saw on the net):

try{
  URL urlLink = new URL("http://206.188.19.131/p4p101.flv");

  // Serve the file
  InputStream in = urlLink.openStream();
  FileOutputStream fos = new FileOutputStream("/sdcard/tempFlash.flv");
  byte[] buf = new byte[4 * 1024]; // 4K buffer
  int bytesRead;
  while ((bytesRead = in.read(buf)) != -1) {
    fos.write(buf, 0, bytesRead);
  }
  fos.close();
  in.close();
}
catch(Exception e){}

try{
  Intent intent = new Intent();
  intent.setAction(android.content.Intent.ACTION_VIEW);
  File file = new File("/sdcard/tempFlash.flv");
  intent.setDataAndType(Uri.fromFile(file), "flash/*");
  startActivity(intent);
}
catch (ActivityNotFoundException e) {
  Toast toast = Toast.makeText(this, "No apps to launch activity", 1000);
  toast.show();
}
+3
source share
2 answers

maybe this might help: http://www.synesthesia.it/playing-flash-flv-videos-in-android-applications playing FLV on Android using a flash player inside a web browser

0

mimetype: video/x-flv flv-application/octet-stream

0

Source: https://habr.com/ru/post/1781536/


All Articles