Android Open Source - AudioChoice Basic Stream Media Player






From Project

Back to project page AudioChoice.

License

The source code is released under:

Apache License

If you think the Android project AudioChoice listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.hwrdprkns.audiochoice;
//from   w  w  w  . j a  v a  2 s  . c o m
import android.content.Context;
import android.util.Log;

import java.io.IOException;

public class BasicStreamMediaPlayer extends BasicMediaPlayer {

    private final static String TAG = BasicStreamMediaPlayer.class.getSimpleName();

    private final static String WILDFIRE = "https://dl.dropboxusercontent.com/u/4676303/wildfire.mp3";

    public BasicStreamMediaPlayer(Context context, IPlayerView playerView) {
        super(context, playerView);
    }

    @Override public void start() {
        if (getMediaPlayer().isPlaying()) return;

        try {
            shouldBePlaying = true;
            if (!isPrepared) {
                getMediaPlayer().setDataSource(getStreamUri());
                getMediaPlayer().prepareAsync();
            } else {
                getMediaPlayer().start();
            }
        } catch (IOException e) {
            Log.d(TAG, "Exception when starting" + e.getMessage());
        }
    }

    protected String getStreamUri() {
        return WILDFIRE;
    }
}




Java Source Code List

com.hwrdprkns.audiochoice.BasicMediaExtractorMediaPlayer.java
com.hwrdprkns.audiochoice.BasicMediaPlayer.java
com.hwrdprkns.audiochoice.BasicProxyMediaPlayer.java
com.hwrdprkns.audiochoice.BasicStreamMediaPlayer.java
com.hwrdprkns.audiochoice.IAudioPlayer.java
com.hwrdprkns.audiochoice.IPlayerView.java
com.hwrdprkns.audiochoice.MainActivity.java
com.hwrdprkns.audiochoice.MainFragment.java
com.hwrdprkns.audiochoice.server.AudioChoiceLocalServer.java
com.hwrdprkns.audiochoice.server.NanoHTTPD.java