मैं ऐप विकसित कर रहा हूं जिसमें मुझे लाइव टीवी स्ट्रीमिंग लागू करना है। मेरी Google खोज ने मुझे विश्वास दिलाया है कि 2.1 एंड्रॉइड तक लाइव स्ट्रीमिंग संभव नहीं है।टीवी की एंड्रॉइड लाइव स्ट्रीमिंग
क्या यह सही है?
मैं और विधि के नीचे की स्थापना करके मैं इसे के प्रकार का उपयोग कर सकते मीडियाप्लेयर के straming संगीत का कोड प्राप्त के रूप में:
mp.setAudioStreamType(2)
;
लेकिन मैं जानना चाहता हूँ यह स्ट्रीमिंग बस ऐसे ही कोड के लिए पर्याप्त है और विधि के नीचे की तरह फाइल को सेव करें:
private void setDataSource(String path) throws IOException {
if (!URLUtil.isNetworkUrl(path)) {
mp.setDataSource(path);
} else {
Log.i("enter the setdata","enter the setdata");
URL url = new URL(path);
URLConnection cn = url.openConnection();
cn.connect();
InputStream stream = cn.getInputStream();
if (stream == null)
throw new RuntimeException("stream is null");
File temp = File.createTempFile("mediaplayertmp", "dat");
String tempPath = temp.getAbsolutePath();
FileOutputStream out = new FileOutputStream(temp);
byte buf[] = new byte[128];
do {
int numread = stream.read(buf);
if (numread <= 0)
break;
out.write(buf, 0, numread);
} while (true);
mp.setDataSource(tempPath);
try {
stream.close();
Log.i("exit the setdata","exit the setdata");
}
catch (IOException ex) {
Log.e(TAG, "error: " + ex.getMessage(), ex);
}
}
}
वहाँ लाइव टीवी स्ट्रीमिंग के लिए आवश्यक किसी भी अतिरिक्त सामान है? कृपया मुझे गाइड करें।
टीवी स्ट्रीमिंग का मतलब क्या है? आप किस प्रोटोकॉल का उपयोग कर रहे हैं। – dongshengcn
एंड्रॉइड 1.x (उदाहरण के लिए [एसएफआर टीवी] (https://market.android.com/details?id=com.sfr.android.mobiletv&feature=search_result) के लिए एक मोबाइल टीवी एप्लिकेशन है। केवल फ्रांस में काम करता है आपके पास एक एसएफआर सदस्यता है। – david
कृपया साझा करें कि आप इसे कैसे हल करते हैं? –