1. *** New version of B4J is available ***
    B4J v7.8
    Dismiss Notice

B4J Question B4J equivalent code

Discussion in 'B4J Questions' started by jcesar, Jun 3, 2019.

  1. jcesar

    jcesar Active Member Licensed User

    Hi this java code connects to a online radio and use a player to play the stream.

    Anyone knows what is the b4j code to do this ?

    Code:
    OkHttpClient client = new OkHttpClient();
            Request request = new Request.Builder()
            .url(
    "http://uplink.duplexfx.com:8800/")
            .build();

            Response response = client.newCall(request).execute();
            
    InputStream stream = response.body().byteStream();
     
    Last edited: Jun 3, 2019
  2. PatrikCavina

    PatrikCavina Active Member Licensed User

    Code:
    Dim job As HttpJob
        job.Initialize(
    "", Me)
        job.Download(
    "http://uplink.duplexfx.com:8800/")
        
    Wait For (job) JobDone (job As HttpJob)
        
    Dim in As InputStream = job.GetInputStream
        job.Release
     
    jcesar likes this.
  3. Erel

    Erel Administrator Staff Member Licensed User

    Have you tried to play it with MediaPlayer?
     
    BillMeyer likes this.
  4. jcesar

    jcesar Active Member Licensed User

    Not yet.

    The media player supports audio streaming ?
     
  5. mcqueccu

    mcqueccu Active Member Licensed User

Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice