{ "id": "170991", "key": "TIMOB-25732", "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": "3", "description": "The problem is a duplicate of an existing issue.", "name": "Duplicate" }, "resolutiondate": "2018-01-29T19:54:39.000+0000", "created": "2018-01-28T10:49:46.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [], "versions": [], "issuelinks": [], "assignee": null, "updated": "2018-08-06T17:41:12.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": [], "description": "trying to get the status of the video playback but the constants are all undefined, hence my logic is not working...\r\n\r\nto reproduce:\r\n\r\n1) \r\nvar activeAd = Titanium.Media.createVideoPlayer({\r\n\turl :\"select a video file\",\r\n\tbackgroundColor : '#fffae8',\r\n\tscalingMode : Titanium.Media.VIDEO_SCALING_MODE_FILL,\r\n\tshowsControls : false,\r\n\tautoplay : true\r\n});\r\n\r\n\r\n2) add below event listeners\r\n\r\nactiveAd.addEventListener(\"complete\", adWatchCalculate);\r\nactiveAd.addEventListener(\"error\", adWatchCalculate);\r\n// activeAd.addEventListener(\"playbackstate\", adWatchCalculate);\r\nactiveAd.addEventListener(\"playbackstate\", function(e) {\r\n\tconsole.log('e.playbackState ' + e.playbackState);\r\n\tconsole.log('Titanium.Media.VIDEO_PLAYBACK_STATE_PLAYING ' + Titanium.Media.VIDEO_PLAYBACK_STATE_PLAYING);\r\n\tconsole.log('Titanium.Media.VIDEO_PLAYBACK_STATE_INTERRUPTED ' + Titanium.Media.VIDEO_PLAYBACK_STATE_INTERRUPTED);\r\n\tconsole.log('Titanium.Media.VIDEO_PLAYBACK_STATE_PAUSED ' + Titanium.Media.VIDEO_PLAYBACK_STATE_PAUSED);\r\n\tconsole.log('Titanium.Media.VIDEO_PLAYBACK_STATE_STOPPED ' + Titanium.Media.VIDEO_PLAYBACK_STATE_STOPPED);\r\n\r\n\r\n\tif (e.playbackState == Titanium.Media.VIDEO_PLAYBACK_STATE_PLAYING) {\r\n\t\tadLoadSuccess = true;\r\n\t\tconsole.log('true');\r\n\t}\r\n});\r\n\r\n\r\nOUTCOME IS as below:\r\n[INFO] : e.playbackState 0\r\n[INFO] : Titanium.Media.VIDEO_PLAYBACK_STATE_PLAYING undefined\r\n[INFO] : Titanium.Media.VIDEO_PLAYBACK_STATE_INTERRUPTED undefined\r\n[INFO] : Titanium.Media.VIDEO_PLAYBACK_STATE_PAUSED undefined\r\n[INFO] : Titanium.Media.VIDEO_PLAYBACK_STATE_STOPPED undefined\r\n\r\nI am trying to figure out if the video has started to play, but unable to...", "attachment": [], "flagged": false, "summary": "Titanium.Video constants, VIDEO_PLABACK_STATE_PLAYING etc don't work", "creator": { "name": "isener", "key": "isener", "displayName": "ILAY SENER", "active": true, "timeZone": "Australia/Sydney" }, "subtasks": [], "reporter": { "name": "isener", "key": "isener", "displayName": "ILAY SENER", "active": true, "timeZone": "Australia/Sydney" }, "environment": "Mac OSX\r\nStudio build: 5.0.0.201712081732\r\nAppC SDK : 7.0.1", "closedSprints": [ { "id": 997, "state": "closed", "name": "2018 Sprint 03 SDK", "startDate": "2018-01-28T16:23:12.178Z", "endDate": "2018-02-11T16:23:00.000Z", "completeDate": "2018-02-12T04:22:49.354Z", "originBoardId": 114 }, { "id": 990, "state": "closed", "name": "2018 Sprint 02 SDK", "startDate": "2018-01-14T22:48:43.544Z", "endDate": "2018-01-28T22:48:00.000Z", "completeDate": "2018-01-29T16:22:42.911Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "433773", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Hey Ilay, hope you're doing good :-) Fixed as part of 7.0.2 (TIMOB-25640), try it out!", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-01-28T19:41:55.000+0000", "updated": "2018-01-28T19:41:55.000+0000" }, { "id": "433776", "author": { "name": "isener", "key": "isener", "displayName": "ILAY SENER", "active": true, "timeZone": "Australia/Sydney" }, "body": "Thanks Hans. \r\n\r\nAll is well, and hot here. How about yourself?\r\n\r\nCheers, found a way around but will test 7.0.2.", "updateAuthor": { "name": "isener", "key": "isener", "displayName": "ILAY SENER", "active": true, "timeZone": "Australia/Sydney" }, "created": "2018-01-28T19:58:34.000+0000", "updated": "2018-01-28T19:58:34.000+0000" }, { "id": "433778", "author": { "name": "isener", "key": "isener", "displayName": "ILAY SENER", "active": true, "timeZone": "Australia/Sydney" }, "body": "Hi Hans,\r\n\r\nIssue seems to continue for 2 of the constants, seeking forward and backward. Please see below.\r\n\r\n[INFO] : Titanium.Media.VIDEO_PLAYBACK_STATE_INTERRUPTED 3\r\n[INFO] : Titanium.Media.VIDEO_PLAYBACK_STATE_PAUSED 2\r\n[INFO] : Titanium.Media.VIDEO_PLAYBACK_STATE_PLAYING 1\r\n[INFO] : Titanium.Media.VIDEO_PLAYBACK_STATE_SEEKING_BACKWARD undefined\r\n[INFO] : Titanium.Media.VIDEO_PLAYBACK_STATE_SEEKING_FORWARD undefined\r\n[INFO] : Titanium.Media.VIDEO_PLAYBACK_STATE_STOPPED 0", "updateAuthor": { "name": "isener", "key": "isener", "displayName": "ILAY SENER", "active": true, "timeZone": "Australia/Sydney" }, "created": "2018-01-28T22:56:56.000+0000", "updated": "2018-01-28T22:56:56.000+0000" }, { "id": "433779", "author": { "name": "isener", "key": "isener", "displayName": "ILAY SENER", "active": true, "timeZone": "Australia/Sydney" }, "body": "2 of the constants are not fixed. please see the update.\r\n\r\nSDK 7.0.2.", "updateAuthor": { "name": "isener", "key": "isener", "displayName": "ILAY SENER", "active": true, "timeZone": "Australia/Sydney" }, "created": "2018-01-28T22:58:47.000+0000", "updated": "2018-01-28T22:58:47.000+0000" }, { "id": "433795", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~isener] They have been removed in 7 as Apple does not currently offer them in their new APIs that we use since 7. The one we used before was deprecated a few years ago and should not be used anymore. This is also documented [here|https://github.com/appcelerator/titanium_mobile/pull/9715/files#diff-1041307683116a293d655456d80bb543R1364].", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-01-29T11:37:56.000+0000", "updated": "2018-01-29T11:37:56.000+0000" }, { "id": "433807", "author": { "name": "isener", "key": "isener", "displayName": "ILAY SENER", "active": true, "timeZone": "Australia/Sydney" }, "body": "Thanks Hans. \r\n\r\nThat I didn't know. I guess updated documentation is to come.", "updateAuthor": { "name": "isener", "key": "isener", "displayName": "ILAY SENER", "active": true, "timeZone": "Australia/Sydney" }, "created": "2018-01-29T19:52:38.000+0000", "updated": "2018-01-29T19:52:38.000+0000" }, { "id": "440021", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing as a duplicate. If this is in error, please reopen.", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-08-06T17:41:12.000+0000", "updated": "2018-08-06T17:41:12.000+0000" } ], "maxResults": 7, "total": 7, "startAt": 0 } } }