{ "id": "170704", "key": "TIMOB-25640", "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": "20060", "description": "", "name": "Release 7.0.2", "archived": false, "released": true, "releaseDate": "2018-02-09" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2018-01-17T09:21:18.000+0000", "created": "2018-01-02T17:54:33.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "ios", "videoplayer" ], "versions": [ { "id": "17609", "description": "", "name": "Release 7.0.0", "archived": false, "released": true, "releaseDate": "2017-12-07" } ], "issuelinks": [ { "id": "56294", "type": { "id": "10122", "name": "Gantt: start-finish", "inward": "is triggered by", "outward": "is triggering" }, "outwardIssue": { "id": "171032", "key": "TIMOB-25752", "fields": { "summary": "iOS: 7.0.2 RC fails to build on device due to Ti.Media errors", "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" } }, "priority": { "name": "Critical", "id": "1" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2018-02-05T15:20:18.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": "Hello,\r\n\r\nIn iOS on SDK 7.0.0+, the playbackState constants are `*undefined*` (http://docs.appcelerator.com/platform/latest/#!/api/Titanium.Media.VideoPlayer-property-playbackState). \r\n\r\n- Ti.Media.VIDEO_PLAYBACK_STATE_INTERRUPTED \r\n- Ti.Media.VIDEO_PLAYBACK_STATE_PAUSED \r\n- Ti.Media.VIDEO_PLAYBACK_STATE_PLAYING \r\n- Ti.Media.VIDEO_PLAYBACK_STATE_SEEKING_BACKWARD \r\n- Ti.Media.VIDEO_PLAYBACK_STATE_SEEKING_FORWARD \r\n- Ti.Media.VIDEO_PLAYBACK_STATE_STOPPED \r\n\r\n*Testing Environment:*\r\nAppcelerator Command-Line Interface, version 7.0.1\r\nSDK: 7.0.1.GA\r\niOS simulator: iPhone 7\r\n\r\n*Test Code:*\r\n{code}\r\nvar vidWin = Titanium.UI.createWindow({\r\n title : 'Video View Demo',\r\n backgroundColor : '#fff'\r\n});\r\n \r\nvar videoPlayer = Titanium.Media.createVideoPlayer({\r\n top : 2,\r\n autoplay : true,\r\n backgroundColor : 'blue',\r\n height : 300,\r\n width : 300,\r\n mediaControlStyle : Titanium.Media.VIDEO_CONTROL_DEFAULT,\r\n scalingMode : Titanium.Media.VIDEO_SCALING_ASPECT_FIT\r\n});\r\n\r\n// Log raw-values of constants\r\nTi.API.info('Titanium.Media.VIDEO_PLAYBACK_STATE_INTERRUPTED ' + Titanium.Media.VIDEO_PLAYBACK_STATE_INTERRUPTED);\r\nTi.API.info('Titanium.Media.VIDEO_PLAYBACK_STATE_PLAYING ' + Titanium.Media.VIDEO_PLAYBACK_STATE_PLAYING);\r\nTi.API.info('Titanium.Media.VIDEO_PLAYBACK_STATE_STOPPED ' + Titanium.Media.VIDEO_PLAYBACK_STATE_STOPPED);\r\n \r\nvideoPlayer.url = 'video.mp4';\r\nvidWin.add(videoPlayer);\r\nvideoPlayer.addEventListener('playbackstate', function() {\r\n \r\n var message = 'Unknown';\r\n switch (videoPlayer.playbackState) {\r\n case Ti.Media.VIDEO_PLAYBACK_STATE_INTERRUPTED:\r\n message = 'Interrupted';\r\n break;\r\n case Ti.Media.VIDEO_PLAYBACK_STATE_PLAYING:\r\n message = 'Playing';\r\n break;\r\n case Ti.Media.VIDEO_PLAYBACK_STATE_PAUSED:\r\n message = 'Paused';\r\n break;\r\n case Ti.Media.VIDEO_PLAYBACK_STATE_STOPPED:\r\n message = 'Stopped';\r\n }\r\n \r\n Ti.API.info(message); \r\n});\r\n \r\nvidWin.open();\r\n{code}\r\n\r\n*Test Results:*\r\n{code}\r\n[INFO] : Titanium.Media.VIDEO_PLAYBACK_STATE_INTERRUPTED undefined\r\n[INFO] : Titanium.Media.VIDEO_PLAYBACK_STATE_PLAYING undefined\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 undefined\r\n{code}", "attachment": [ { "id": "63893", "filename": "video.mp4", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-01-04T10:09:21.000+0000", "size": 383631, "mimeType": "video/mp4" } ], "flagged": false, "summary": "iOS: Ti.Media.VideoPlayer \"playbackState\" constants are undefined", "creator": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "subtasks": [], "reporter": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "environment": "iOS,VideoPlayer,playbackstate", "closedSprints": [ { "id": 985, "state": "closed", "name": "2018 Sprint 01 SDK", "startDate": "2017-12-31T16:58:54.631Z", "endDate": "2018-01-14T16:58:00.000Z", "completeDate": "2018-01-17T22:44:27.028Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "432672", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "As discussed yesterday, release 7.0.0 replaced the underlaying API of the Ti.Media.VideoPlayer (MPMoviePlayerController) with the most recent API (AVPlayerViewController) that has a slightly different API. [~vijaysingh] will have more insight here, but the newer way of getting the current video state is to use the {{playbackState}} property itself, rather than the constants. I think the docs still need to be updated there and some parity work was missing in the initial 7.0.0.\r\n\r\nScheduling this ticket for 7.1.0 to address the documentation- and possible parity-issues.\r\n\r\nFor this particular case: To check whether the movie is currently playing, check if the {{playbackState}} property returns a value > 0. ", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-01-03T10:27:02.000+0000", "updated": "2018-01-03T10:28:21.000+0000" }, { "id": "432743", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "PR (master): https://github.com/appcelerator/titanium_mobile/pull/9714\r\nPR (7_0_X): https://github.com/appcelerator/titanium_mobile/pull/9715\r\n\r\nTest-Case (use the attached mp4 file, as well as the test-case above):\r\n{code:js}\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor: '#fff'\r\n});\r\n\r\nvar video = Ti.Media.createVideoPlayer({\r\n url: 'video.mp4',\r\n height: 200\r\n});\r\n\r\nvar btnPlay = Ti.UI.createButton({\r\n title: 'Play Video',\r\n top: 40\r\n});\r\n\r\nbtnPlay.addEventListener('click', function(e) {\r\n video.play();\r\n});\r\n\r\nvar btn = Ti.UI.createButton({\r\n title: 'Get current state',\r\n top: 100\r\n});\r\n\r\nbtn.addEventListener('click', function(e) {\r\n var message = 'Unknown';\r\n \r\n switch (video.playbackState) {\r\n case Ti.Media.VIDEO_PLAYBACK_STATE_INTERRUPTED:\r\n message = 'Interrupted';\r\n break;\r\n case Ti.Media.VIDEO_PLAYBACK_STATE_PLAYING:\r\n message = 'Playing';\r\n break;\r\n case Ti.Media.VIDEO_PLAYBACK_STATE_PAUSED:\r\n message = 'Paused';\r\n break;\r\n case Ti.Media.VIDEO_PLAYBACK_STATE_STOPPED:\r\n message = 'Stopped';\r\n }\r\n \r\n Ti.API.info(message);\r\n});\r\n\r\nwin.add(btnPlay);\r\nwin.add(btn);\r\nwin.add(video);\r\n\r\nwin.open();\r\n{code}", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-01-04T10:06:25.000+0000", "updated": "2018-01-10T10:29:39.000+0000" }, { "id": "433204", "author": { "name": "amukherjee", "key": "amukherjee", "displayName": "Abir Mukherjee", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR passed.", "updateAuthor": { "name": "amukherjee", "key": "amukherjee", "displayName": "Abir Mukherjee", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-01-16T18:48:31.000+0000", "updated": "2018-01-16T18:48:31.000+0000" }, { "id": "433626", "author": { "name": "amukherjee", "key": "amukherjee", "displayName": "Abir Mukherjee", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified fix is found in:\r\nSDK 7.0.2.v20180124113923\r\nSDK 7.1.0.v20180124115505", "updateAuthor": { "name": "amukherjee", "key": "amukherjee", "displayName": "Abir Mukherjee", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-01-24T23:00:12.000+0000", "updated": "2018-01-24T23:00:12.000+0000" } ], "maxResults": 8, "total": 8, "startAt": 0 } } }