aboutsummaryrefslogtreecommitdiff
path: root/subsonic-android/src/github
diff options
context:
space:
mode:
authorowner <owner@DeeDee-Laptop>2012-12-02 15:59:50 -0800
committerowner <owner@DeeDee-Laptop>2012-12-02 15:59:50 -0800
commit9f9bff0d03e0d1b1c4a00321bb377b3c31809e64 (patch)
tree0ea4ad468e410217c2f3bd49d7b23caef670740f /subsonic-android/src/github
parent89bdb9e10c74fb3f8ea7b581e44ed3ce96f00ad0 (diff)
downloaddsub-9f9bff0d03e0d1b1c4a00321bb377b3c31809e64.tar.gz
dsub-9f9bff0d03e0d1b1c4a00321bb377b3c31809e64.tar.bz2
dsub-9f9bff0d03e0d1b1c4a00321bb377b3c31809e64.zip
Stream videos with external player
Diffstat (limited to 'subsonic-android/src/github')
-rw-r--r--subsonic-android/src/github/daneren2005/dsub/activity/SelectAlbumActivity.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/subsonic-android/src/github/daneren2005/dsub/activity/SelectAlbumActivity.java b/subsonic-android/src/github/daneren2005/dsub/activity/SelectAlbumActivity.java
index 891c2edd..a8f2e24c 100644
--- a/subsonic-android/src/github/daneren2005/dsub/activity/SelectAlbumActivity.java
+++ b/subsonic-android/src/github/daneren2005/dsub/activity/SelectAlbumActivity.java
@@ -22,6 +22,8 @@ import github.daneren2005.dsub.view.EntryAdapter;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
+import android.content.pm.PackageManager;
+import android.content.pm.ResolveInfo;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
@@ -311,6 +313,9 @@ public class SelectAlbumActivity extends SubsonicTabActivity {
case R.id.song_menu_play_external:
playExternalPlayer(entry);
break;
+ case R.id.song_menu_stream_external:
+ streamExternalPlayer(entry);
+ break;
case R.id.song_menu_remove_playlist:
String playlistId = getIntent().getStringExtra(Constants.INTENT_EXTRA_NAME_PLAYLIST_ID);
String playlistName = getIntent().getStringExtra(Constants.INTENT_EXTRA_NAME_PLAYLIST_NAME);
@@ -544,6 +549,18 @@ public class SelectAlbumActivity extends SubsonicTabActivity {
startActivity(intent);
}
}
+ private void streamExternalPlayer(MusicDirectory.Entry entry) {
+ Intent intent = new Intent(Intent.ACTION_VIEW);
+ intent.setDataAndType(Uri.parse(MusicServiceFactory.getMusicService(this).getVideoStreamUrl(this, entry.getId())), "video/*");
+
+ List<ResolveInfo> intents = getPackageManager()
+ .queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY);
+ if(intents != null && intents.size() > 0) {
+ startActivity(intent);
+ } else {
+ Util.toast(this, R.string.download_no_streaming_player);
+ }
+ }
private void checkLicenseAndTrialPeriod(Runnable onValid) {
if (licenseValid) {