{ "id": "77789", "key": "TIMOB-4665", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "11364", "description": "Mobile 1.8.0 M11", "name": "Sprint 2011-32", "archived": true, "released": true, "releaseDate": "2011-08-15" } ], "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2011-08-08T13:43:30.000+0000", "created": "2011-07-13T16:03:21.000+0000", "priority": { "name": "Trivial", "id": "5" }, "labels": [], "versions": [ { "id": "11367", "description": "", "name": "Release 1.7.1", "archived": true, "released": true, "releaseDate": "2011-06-21" } ], "issuelinks": [], "assignee": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-29T21:52:34.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "h1. Problem:\r\nAudioPlayer does not play streaming media over the Internet.\r\n\r\n{quote}\r\nThis works fine on url / files but not on streams like SHOUTcast\r\nhttp://www.shoutcast.com\r\n\r\nI have never gotten the onload / onerror event fired on a XMLHttpRequest\r\n\r\nh5. Customer \r\nwants to avoid -> File Error: _\"Unable to configure network read stream\"_\r\n{quote}\r\n\r\n{code:title=app.js|borderStyle=solid}\r\nvar audio_stream = Titanium.Media.createAudioPlayer();\r\nvar playing = false;\r\nvar now_playing_data_timer = undefined;\r\nvar tabGroup = Ti.UI.createTabGroup();\r\n \r\nvar win = Titanium.UI.createWindow({ \r\n title:'Listen',\r\n backgroundColor:'#000'\r\n});\r\nvar tab = Titanium.UI.createTab({ \r\n \ticon:'KS_nav_views.png',\r\n \ttitle:'Listen',\r\n \twindow:win\r\n});\r\nvar text = Titanium.UI.createLabel({\r\n \tcolor:'blue',\r\n \ttext:'Song:',\r\n \twidth:'auto',\r\n \ttop: 0,\r\n \tleft:0\r\n}); \r\nvar imageview = Titanium.UI.createImageView({\r\n \timage:\"http://2.bp.blogspot.com/_ZqpzRV9D624/TNnn-FLSgmI/AAAAAAAAAAs/8ca4flYJKhg/S350/logo%2Bde%2Bmusica%2B1.png\",\r\n \theight:100,\r\n \twidth:110,\r\n \ttop:150,\r\n \tbackgroundColor:'white'\r\n});\r\nvar play_button = Titanium.UI.createButton({\r\n image: \"playbutton.png\",\r\n width: 110,\r\n height: 80,\r\n top: 10,\r\n title:\"Play\",\r\n color: \"red\"\r\n});\r\nvar play_stream = function(stream_url){\r\n \tplaying = true;\r\n audio_stream.setUrl(stream_url);\r\n audio_stream.start();\r\n};\r\nvar stop_stream = function(){\r\n playing = false;\r\n audio_stream.stop();\r\n};\r\nwin.addEventListener('open', function(e) {\r\n\tinit();\r\n}); \r\nvar init = function() {\r\n\twin.add(text);\r\n win.add(play_button);\r\n win.add(imageview);\r\n}; \r\nplay_button.addEventListener('click',function()\r\n{\r\n var xhr = Ti.Network.createHTTPClient();\r\n \tvar stream_url = 'http://yp.shoutcast.com/sbin/tunein-station.pls?id=1268400';\r\n\r\n\txhr.onload = function(e) {\r\n\t\tplaying = true;\r\n \t\taudio_stream.setUrl(stream_url);\r\n \taudio_stream.start();\r\n\t};\r\n \r\n\txhr.onerror = function(e) {\r\n\t\talert(e.error);\r\n\t};\r\n \txhr.setTimeout(10000);\r\n\txhr.open('GET', stream_url);\r\n\txhr.file = Titanium.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory,'tunein-station.pls');\r\n\txhr.send(); \t\r\n});\r\ntabGroup.addTab(tab);\r\ntabGroup.open();\r\n{code} \r\n\r\nh3. Associated Helpdesk Ticket\r\n\r\nhttp://support.appcelerator.com/tickets/APP-577977", "attachment": [ { "id": "21829", "filename": "playbutton.png", "author": { "name": "mvizcaino", "key": "mvizcaino", "displayName": "Miguel Vizcaino", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-07-13T16:03:21.000+0000", "size": 3223, "mimeType": "image/png" } ], "flagged": false, "summary": "iPhone: AudioPlayer does not play streaming media", "creator": { "name": "mvizcaino", "key": "mvizcaino", "displayName": "Miguel Vizcaino", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "mvizcaino", "key": "mvizcaino", "displayName": "Miguel Vizcaino", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "162173", "author": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The url in the sample code does not contain a stream. Instead, it is a text file, not sound. It is the end developer's responsibility to parse the text file, find urls in it that actually _are_ of streams, and then pass a stream url to audioPlayer.", "updateAuthor": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-08-08T13:43:30.000+0000", "updated": "2011-08-08T13:43:30.000+0000" }, { "id": "220312", "author": { "name": "alexistkd", "key": "alexistkd", "displayName": "Alexis Gaitan", "active": true, "timeZone": "America/Chicago" }, "body": "same issue, can be fixed?", "updateAuthor": { "name": "alexistkd", "key": "alexistkd", "displayName": "Alexis Gaitan", "active": true, "timeZone": "America/Chicago" }, "created": "2012-09-23T15:37:30.000+0000", "updated": "2012-09-23T15:37:30.000+0000" }, { "id": "416275", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as invalid.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-29T21:52:34.000+0000", "updated": "2017-03-29T21:52:34.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }