{"action":"created","issue":{"url":"https://api.github.com/repos/google/ExoPlayer/issues/4572","repository_url":"https://api.github.com/repos/google/ExoPlayer","labels_url":"https://api.github.com/repos/google/ExoPlayer/issues/4572/labels{/name}","comments_url":"https://api.github.com/repos/google/ExoPlayer/issues/4572/comments","events_url":"https://api.github.com/repos/google/ExoPlayer/issues/4572/events","html_url":"https://github.com/google/ExoPlayer/issues/4572","id":344431639,"node_id":"MDU6SXNzdWUzNDQ0MzE2Mzk=","number":4572,"title":"How to use transportControls.playFromUri","user":{"login":"Lukaaaa","id":12089870,"node_id":"MDQ6VXNlcjEyMDg5ODcw","avatar_url":"https://avatars2.githubusercontent.com/u/12089870?v=4","gravatar_id":"","url":"https://api.github.com/users/Lukaaaa","html_url":"https://github.com/Lukaaaa","followers_url":"https://api.github.com/users/Lukaaaa/followers","following_url":"https://api.github.com/users/Lukaaaa/following{/other_user}","gists_url":"https://api.github.com/users/Lukaaaa/gists{/gist_id}","starred_url":"https://api.github.com/users/Lukaaaa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lukaaaa/subscriptions","organizations_url":"https://api.github.com/users/Lukaaaa/orgs","repos_url":"https://api.github.com/users/Lukaaaa/repos","events_url":"https://api.github.com/users/Lukaaaa/events{/privacy}","received_events_url":"https://api.github.com/users/Lukaaaa/received_events","type":"User","site_admin":false},"labels":[{"id":106814994,"node_id":"MDU6TGFiZWwxMDY4MTQ5OTQ=","url":"https://api.github.com/repos/google/ExoPlayer/labels/question","name":"question","color":"cc317c","default":true}],"state":"open","locked":false,"assignee":{"login":"marcbaechinger","id":584321,"node_id":"MDQ6VXNlcjU4NDMyMQ==","avatar_url":"https://avatars3.githubusercontent.com/u/584321?v=4","gravatar_id":"","url":"https://api.github.com/users/marcbaechinger","html_url":"https://github.com/marcbaechinger","followers_url":"https://api.github.com/users/marcbaechinger/followers","following_url":"https://api.github.com/users/marcbaechinger/following{/other_user}","gists_url":"https://api.github.com/users/marcbaechinger/gists{/gist_id}","starred_url":"https://api.github.com/users/marcbaechinger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcbaechinger/subscriptions","organizations_url":"https://api.github.com/users/marcbaechinger/orgs","repos_url":"https://api.github.com/users/marcbaechinger/repos","events_url":"https://api.github.com/users/marcbaechinger/events{/privacy}","received_events_url":"https://api.github.com/users/marcbaechinger/received_events","type":"User","site_admin":false},"assignees":[{"login":"marcbaechinger","id":584321,"node_id":"MDQ6VXNlcjU4NDMyMQ==","avatar_url":"https://avatars3.githubusercontent.com/u/584321?v=4","gravatar_id":"","url":"https://api.github.com/users/marcbaechinger","html_url":"https://github.com/marcbaechinger","followers_url":"https://api.github.com/users/marcbaechinger/followers","following_url":"https://api.github.com/users/marcbaechinger/following{/other_user}","gists_url":"https://api.github.com/users/marcbaechinger/gists{/gist_id}","starred_url":"https://api.github.com/users/marcbaechinger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcbaechinger/subscriptions","organizations_url":"https://api.github.com/users/marcbaechinger/orgs","repos_url":"https://api.github.com/users/marcbaechinger/repos","events_url":"https://api.github.com/users/marcbaechinger/events{/privacy}","received_events_url":"https://api.github.com/users/marcbaechinger/received_events","type":"User","site_admin":false}],"milestone":null,"comments":0,"created_at":"2018-07-25T12:55:37Z","updated_at":"2018-07-25T13:33:34Z","closed_at":null,"author_association":"NONE","body":"I just want to start an audio live stream. How can this be achieved, i have tried:\r\n``` transportControls.playFromUri(Uri.parse(\"http://mp3stream2.apasf.apa.at:8000/\"), null) ```\r\n\r\nand also implemented the method in UampPlaybackPreparer\r\n```\r\noverride fun onPrepareFromUri(uri: Uri?, extras: Bundle?) {\r\n            val mediaSource = ExtractorMediaSource.Factory(dataSourceFactory).createMediaSource(uri));\r\n            exoPlayer.prepare(mediaSource)\r\n}\r\n```\r\nonPrepareFromUri is never called and requested stream does not start. \r\nCould you provide a short snipped/explanation how to play an audio livestream from static URL.\r\n"},"comment":{"url":"https://api.github.com/repos/google/ExoPlayer/issues/comments/407755487","html_url":"https://github.com/google/ExoPlayer/issues/4572#issuecomment-407755487","issue_url":"https://api.github.com/repos/google/ExoPlayer/issues/4572","id":407755487,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNzc1NTQ4Nw==","user":{"login":"marcbaechinger","id":584321,"node_id":"MDQ6VXNlcjU4NDMyMQ==","avatar_url":"https://avatars3.githubusercontent.com/u/584321?v=4","gravatar_id":"","url":"https://api.github.com/users/marcbaechinger","html_url":"https://github.com/marcbaechinger","followers_url":"https://api.github.com/users/marcbaechinger/followers","following_url":"https://api.github.com/users/marcbaechinger/following{/other_user}","gists_url":"https://api.github.com/users/marcbaechinger/gists{/gist_id}","starred_url":"https://api.github.com/users/marcbaechinger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcbaechinger/subscriptions","organizations_url":"https://api.github.com/users/marcbaechinger/orgs","repos_url":"https://api.github.com/users/marcbaechinger/repos","events_url":"https://api.github.com/users/marcbaechinger/events{/privacy}","received_events_url":"https://api.github.com/users/marcbaechinger/received_events","type":"User","site_admin":false},"created_at":"2018-07-25T13:33:34Z","updated_at":"2018-07-25T13:33:34Z","author_association":"CONTRIBUTOR","body":"You are doing the right thing. The snippet you show should work. \r\n\r\nIf you've taken the code from UAMP, I think you may also have taken over `getSupportedPrepareActions()` which returns the actions the `UampPlaybackPreparer` supports. UAMP does not support all actions. So you may want to add the                     `PlaybackStateCompat.ACTION_PLAY_FROM_URI `to the method to make sure the connector calls the preparer when `transportControls.playFromUri` is called:\r\n\r\n    override fun getSupportedPrepareActions(): Long =\r\n            PlaybackStateCompat.ACTION_PREPARE_FROM_MEDIA_ID or\r\n                    PlaybackStateCompat.ACTION_PLAY_FROM_MEDIA_ID or\r\n                    PlaybackStateCompat.ACTION_PREPARE_FROM_SEARCH or\r\n                    PlaybackStateCompat.ACTION_PLAY_FROM_SEARCH or\r\n                    PlaybackStateCompat.ACTION_PLAY_FROM_URI\r\n\r\nhttps://github.com/googlesamples/android-UniversalMusicPlayer/blob/master/media/src/main/java/com/example/android/uamp/media/UampPlaybackPreparer.kt#L52"}}
{"actor":{"display_login":"marcbaechinger"}}