[英]Android SDK : Can I convert InputStream to FileInputStream?
我需要將媒體和視頻從samba服務器流式傳輸到android,並且我使用JCIFS從samba文件中獲取輸入流。
但是在MediaPlayer中,只能使用fileinputstream.getFD()播放媒體。
mp = new MediaPlayer();
FileInputStream fis = new FileInputStream(convertedFile);
mp.setDataSource(fis.getFD());
Toast.makeText(this, "Success, Path has been set", Toast.LENGTH_SHORT).show();
mp.prepare();
mp.start();
我無法從inputstream獲取FD(),因此我需要將inputstream轉換為fileinputstream ...
請給我一個建議,或者還有其他解決方案來解決來自samba服務器的流媒體問題?
這是我的SmbFileInputStream,但不等於fileinputstream
SmbFileInputStream f = new SmbFileInputStream(new SmbFile(filePath,auth));
非常感謝。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.