我怎么火的意图开始FLV或SWF到Flash Player 10.1的? [英] How do I fire an intent to start a flv or swf to Flash Player 10.1?
本文介绍了我怎么火的意图开始FLV或SWF到Flash Player 10.1的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一大堆的 FLV视频存储在媒体服务器上的文件,我试图让他们推出的Flash播放器。一直在四处寻找,但没有发现太大的帮助。我已经下载了FLV文件到临时存储,并尝试使用意图
传递给它。这是我的code样子(从我看到的净):
尝试{
URL urlLink =新的URL(http://206.188.19.131/p4p101.flv);
//即成文件
在的InputStream = urlLink.openStream();
FileOutputStream中FOS =新的FileOutputStream(/ SD卡/ tempFlash.flv);
byte []的BUF =新的字节[4 * 1024]; // 4K缓冲
INT读取动作;
而((读取动作= in.read(BUF))!= -1){
fos.write(BUF,0,读取动作);
}
fos.close();
附寄();
}
赶上(例外五){}
尝试{
意向意图=新的意图();
intent.setAction(android.content.Intent.ACTION_VIEW);
档案文件=新的文件(/ SD卡/ tempFlash.flv);
intent.setDataAndType(Uri.fromFile(文件),闪/ *);
startActivity(意向);
}
赶上(ActivityNotFoundException E){
吐司面包= Toast.makeText(这一点,没有应用程序推出的活动,1000);
toast.show();
}
解决方案
可以试着改变你的mimetype: 视频/ X-FLV或FLV应用程序/八位字节流
I have a bunch of flv video files stored on a media server, and I am trying to get them to launch in the flash player. Have been looking around but haven't found much help. I have downloaded the flv file into temporary storage, and try passing it using an intent
. This is what my code looks like (from what I have seen 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();
}
解决方案
may be try to change your mimetype: video/x-flv or flv-application/octet-stream
这篇关于我怎么火的意图开始FLV或SWF到Flash Player 10.1的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文