{ "id": "93649", "key": "TIMOB-9705", "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": [], "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2017-06-09T17:02:10.000+0000", "created": "2012-06-21T14:17:01.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "anvil", "api", "parity" ], "versions": [ { "id": "13271", "description": "Release 2.1.0", "name": "Release 2.1.0", "archived": false, "released": true, "releaseDate": "2012-06-29" } ], "issuelinks": [ { "id": "57190", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "inwardIssue": { "id": "147981", "key": "TIMOB-18925", "fields": { "summary": "Ti.Media.Sound duration property inconsistent value types", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "priority": { "name": "Low", "id": "4" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2019-03-15T01:09:14.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": "10224", "name": "TiAPI", "description": "This component is used for cross-platform API work. Specifications are most likely to use this component." } ], "description": "From Titanium.Media.Sound.time documentation:\r\n{code}\r\nCurrent playback position of the audio.\r\nOn iOS, playback time is reported in seconds.\r\nOn Android, time is reported in milliseconds.\r\n{code}\r\n\r\nTest case:\r\n{code}\r\nvar testRun = {};\r\nfunction valueOf(test, actual) {\r\n\treturn {\r\n\t\tshouldBe : function(expected) {\r\n\t\t\tif (expected != actual) {\r\n\t\t\t\tTi.API.info(\"expected: <\"+expected+\">, actual: <\"+actual+\">\");\r\n\t\t\t}\r\n\t\t},\r\n\t\tshouldBeGreaterThan : function(expected) {\r\n\t\t\tif (actual <= expected) {\r\n\t\t\t\tTi.API.info(\"expected greater than: <\"+expected+\">, actual: <\"+actual+\">\");\t\t\t\t\r\n\t\t\t}\r\n\t\t},\r\n\t\tshouldBeLessThan : function(expected) {\r\n\t\t\tif (actual >= expected) {\r\n\t\t\t\tTi.API.info(\"expected less than: <\"+expected+\">, actual: <\"+actual+\">\");\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n}\r\n\r\nTi.API.info(\"-- start --\");\r\nvar sound = Ti.Media.createSound({ url : 'cricket.wav' });\r\nTitanium.Media.audioSessionMode = Ti.Media.AUDIO_SESSION_MODE_PLAYBACK; \r\nvar initial_pos = 3;\r\nsound.time = initial_pos;\r\nsound.setTime(initial_pos);\r\nvalueOf(testRun, sound.getTime()).shouldBe(initial_pos);\r\nvalueOf(testRun, sound.time).shouldBe(initial_pos);\r\nsound.play();\r\nsetTimeout(function(e) {\r\n\tvar time = sound.getTime();\r\n\tTi.API.info(\"PROGRESS: \" + time);\r\n\tvalueOf(testRun, time).shouldBeGreaterThan(initial_pos);\r\n\t// assume we get an event in < 2 seconds.\r\n\tvalueOf(testRun, time).shouldBeLessThan(initial_pos + 3000); \r\n\tsound.stop();\r\n\tsound = null;\r\n\tTi.API.info(\"-- end --\");\r\n}, 1000);\r\n{code}\r\n\r\nAnvil: media/media - audioTimeValidation", "attachment": [], "flagged": false, "summary": "TiAPI: Titanium.Media.Sound.time units should be consistent between platforms", "creator": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "iOS/Android", "comment": { "comments": [ { "id": "421652", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket due to time passed, any problems please open a new ticket.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-06-09T17:02:10.000+0000", "updated": "2017-06-09T17:02:10.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }