3

Please help me getting started how do i achieve live streaming of video on one device on another using Wifi Direct. I have already established connection between the two devices.What is the next step to follow

madcolonel10
  • 735
  • 2
  • 9
  • 22

1 Answers1

3

Take a look at WIFI-Direct documentation

First you need to establish a connection. there is enough code in the documentation to do that.

Then, then you send the file as a stream and receive it on the other side. Now, based on Android MediaPlayer Documentation you need to send the received stream to the mediaplayer. There are different ways to approach this like saving the stream to a file and then passing the file to the mediaplayer. But a better way is implementing a localhttpserver and passing the local uri to the mediaplayer.

I gathered this info from the links below:

Write to file and stream from it

Modifying FileInputStream for mediaPlayer setDataSource

Android ServerSocket programming with jCIFS streaming files

Create mediaplayer with inputstream in android

Sample Local HTTP server

Community
  • 1
  • 1
Saeid Farivar
  • 1,667
  • 24
  • 43
  • 1
    On other side, Can we send music stream direct to music player than storing it into external/internal sdcard? – Umang Kothari Nov 25 '14 at 12:31
  • well, I believe implementing a localhttpserver will get you the same as you're asking. basically you're providing a stream to the other side instead of sending the whole file and saving it... However I am not sure what you mean by music player, if you meant any music player, my answer is I don't know. – Saeid Farivar Nov 25 '14 at 16:16
  • If I am streaming high definition video, what is the number of nodes that a Group Owner support to have a realistic and good stream ? ie, what are the capabilities of a non entry level device in respect to number of other devices (slaves) it can support? – tony9099 Nov 07 '15 at 11:19