Skip to content

Commit

Permalink
added hls stream support
Browse files Browse the repository at this point in the history
  • Loading branch information
segler-alex committed Mar 5, 2017
1 parent 91bc40d commit 2aee859
Show file tree
Hide file tree
Showing 10 changed files with 433 additions and 95 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ android {
minSdkVersion 8
targetSdkVersion 23

versionCode 37
versionName "0.27"
versionCode 38
versionName "0.28"
}
buildTypes {
release {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ void stopRecording();
boolean isRecording();
String getCurrentRecordFileName();
long getTransferedBytes();
boolean getIsHls();
}
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,9 @@ private void UpdateOutput() {
}

String strExtra = "";
if (PlayerServiceUtil.getIsHls()){
strExtra += "HLS-Stream\n";
}
if (PlayerServiceUtil.getCurrentRecordFileName() != null){
strExtra += getResources().getString(R.string.player_info_record_to,PlayerServiceUtil.getCurrentRecordFileName()) + "\n";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public class PlayerService extends Service implements IStreamProxyEventReceiver
private PowerManager powerManager;
private PowerManager.WakeLock wakeLock;
private WifiManager.WifiLock wifiLock;
private boolean isHls = false;

enum PlayStatus{
Idle,
Expand Down Expand Up @@ -160,6 +161,11 @@ public int getMetadataChannels() throws RemoteException {
return 0;
}

@Override
public boolean getIsHls() throws RemoteException {
return isHls;
}

@Override
public boolean isPlaying() throws RemoteException {
return playStatus != PlayStatus.Idle;
Expand Down Expand Up @@ -474,18 +480,22 @@ private void UpdateNotification() {
}

@Override
public void foundShoutcastStream(ShoutcastInfo info) {
public void foundShoutcastStream(ShoutcastInfo info, boolean isHls) {
this.streamInfo = info;
Log.i(TAG, "Metadata offset:" + info.metadataOffset);
Log.i(TAG, "Bitrate:" + info.bitrate);
Log.i(TAG, "Name:" + info.audioName);
if (info.audioName != null) {
if (!info.audioName.trim().equals("")) {
itsStationName = info.audioName.trim();
this.isHls = isHls;
if (info != null) {
Log.i(TAG, "Metadata offset:" + info.metadataOffset);
Log.i(TAG, "Bitrate:" + info.bitrate);
Log.i(TAG, "Name:" + info.audioName);
Log.i(TAG, "Hls:" + isHls);
if (info.audioName != null) {
if (!info.audioName.trim().equals("")) {
itsStationName = info.audioName.trim();
}
}
Log.i(TAG, "Server:" + info.serverName);
Log.i(TAG, "AudioInfo:" + info.audioInfo);
}
Log.i(TAG, "Server:" + info.serverName);
Log.i(TAG, "AudioInfo:" + info.audioInfo);
sendBroadCast(PLAYER_SERVICE_META_UPDATE);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,17 @@ public static String getCurrentRecordFileName() {
return null;
}

public static boolean getIsHls() {
if (itsPlayerService != null) {
try {
return itsPlayerService.getIsHls();
} catch (RemoteException e) {
Log.e("", "" + e);
}
}
return false;
}

public static long getTransferedBytes() {
if (itsPlayerService != null) {
try {
Expand Down
Loading

0 comments on commit 2aee859

Please sign in to comment.