GithubHelp home page GithubHelp logo

How to put Progressbar about audioview HOT 6 CLOSED

4ertuk avatar 4ertuk commented on July 29, 2024
How to put Progressbar

from audioview.

Comments (6)

4eRTuk avatar 4eRTuk commented on July 29, 2024

Same as for local file except total length could be determined wrong (-1 for example, I think default Android MediaPlayer causes this behaviour).

See demo app for more info:
Java code
XML layout

from audioview.

chunarakaran avatar chunarakaran commented on July 29, 2024

how to put in this code

public class AudioPlayerActivity extends AppCompatActivity {

String Content_id,audio_url;

AudioView audioView;

private ProgressDialog pDialog;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_audio_player);

    audio_url = getIntent().getStringExtra("audio_url");

    // Progress dialog
    pDialog = new ProgressDialog(this);
    pDialog.setCancelable(false);

    audioView=(AudioView)findViewById(R.id.audioview);

// pDialog.setMessage("Please Wait...");
// showDialog();

    try {
        audioView.setDataSource(audio_url);
        audioView.start();
    } catch (IOException e) {
        e.printStackTrace();
    }

// hideDialog();
}

@SuppressLint("MissingSuperCall")
@Override
protected void onStop() {
    super.onPause();
    audioView.pause();
}

@Override
protected void onDestroy() {
    super.onDestroy();
    audioView.pause();
}

private void showDialog() {
    if (!pDialog.isShowing())
        pDialog.show();
}

private void hideDialog() {
    if (pDialog.isShowing())
        pDialog.dismiss();
}

}

from audioview.

4eRTuk avatar 4eRTuk commented on July 29, 2024

I do not see your ProgressBar. Where do you want to put it and what should it do? Default AudioView has SeekBar showing current track percentage completion and allowing to seek over the track.

from audioview.

chunarakaran avatar chunarakaran commented on July 29, 2024

Show progressbar when audio url load

from audioview.

4eRTuk avatar 4eRTuk commented on July 29, 2024

If you download audio to local storage then it's not related question.

If you want to show progress while AudioView is preparing (it does not matter from url or local) then you could implement AudioViewListener for AudioView and override onPrepared() method. Then set listener through AudioView's setOnAudioViewListener().

from audioview.

4eRTuk avatar 4eRTuk commented on July 29, 2024

Closed due to inactivity

from audioview.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.