{ "id": "171646", "key": "TIMOB-26033", "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": "20115", "name": "Release 7.3.0", "archived": false, "released": true, "releaseDate": "2018-08-17" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2018-05-22T09:36:59.000+0000", "created": "2018-05-11T15:45:10.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2018-06-21T18:05:22.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\nThe following error occurs when closing a window with a video player control with SDK 7.1.1.GA on iOS. On Android, it works just fine. \r\n\r\n*Test Environment:*\r\nAppcelerator Command-Line Interface, version 7.0.3\r\nSDK: 7.1.1.GA\r\n\r\n*Test code:*\r\nindex.xml\r\n{code}\r\n\r\n\t\r\n\t\t\r\n\t\r\n\r\n{code}\r\nvideo.xml\r\n{code}\r\n\r\n\t\r\n \r\n \r\n \r\n\t\t\r\n \r\n\r\n{code}\r\nindex.js\r\n{code}\r\nfunction doClick(e) {\r\n\tAlloy.createController('video', {}).getView().open();\r\n}\r\n$.index.open();\r\n{code}\r\nvideo.js\r\n{code}\r\nvar activeMovie = null;\r\nvar videoMedia = null;\r\n\r\n$.videoAdd.addEventListener('click', function(e)\r\n{\r\n Ti.Media.showCamera({\r\n mediaTypes: [Ti.Media.MEDIA_TYPE_VIDEO],\r\n videoMaximumDuration: 300000,\r\n videoQuality: Titanium.Media.QUALITY_MEDIUM,\r\n saveToPhotoGallery: true,\r\n allowEditing: false,\r\n success:function(e){\r\n saveVideoLocal(e.media);\r\n }\r\n });\r\n});\r\n\r\nfunction saveVideoLocal(media) {\r\n videoMedia = media;\r\n}\r\n\r\n$.videoPlay.addEventListener('click', function(e)\r\n{\r\n activeMovie = Titanium.Media.createVideoPlayer({\r\n top : 0,\r\n width : '100%',\r\n bottom:100,\r\n visible:true,\r\n zIndex:999999,\r\n mediaControlStyle : Titanium.Media.VIDEO_CONTROL_DEFAULT,\r\n scalingMode : Titanium.Media.VIDEO_SCALING_ASPECT_FILL,\r\n autoplay : true,\r\n media: videoMedia\r\n });\r\n // Now if I use url instead of media then the video will not play. ( Same of android and iOS)\r\n // If I put a fake url like (url: 'http://fakeMovie.com' and still set media property the video will not play but error will not be thrown)\r\n // You can even put both media and url key above to same videoMedia and it will throw the error.\r\n // Looks like you have to set the url key at the creation of the control to not throw the error.\r\n // But url does not seem to be working for local media where the media key should be used.\r\n\r\n // Also when I get the script error the app will not crash but it will also not recognize\r\n //any future clicks on the listview control on the page that opened the video page.\r\n\r\n $.winVideo.add(activeMovie);\r\n});\r\n$.videoWindowClose.addEventListener('click', function(e)\r\n{\r\n $.winVideo.close();\r\n});\r\n$.winVideo.addEventListener('close', function(e)\r\n{\r\n if (activeMovie != null) {\r\n activeMovie.release();\r\n $.winVideo.remove(activeMovie);\r\n }\r\n activeMovie = null;\r\n\r\n $.destroy();\r\n $.off();\r\n $.winVideo = null;\r\n});\r\n{code}\r\nindex.tss\r\n{code}\r\n\".container\": {\r\n\tbackgroundColor:\"white\"\r\n}\r\n\r\n\"Label\": {\r\n\twidth: Ti.UI.SIZE,\r\n\theight: Ti.UI.SIZE,\r\n\tcolor: \"#000\"\r\n}\r\n\r\n\"#label\": {\r\n\tfont: {\r\n\t\tfontSize: 12\r\n\t}\r\n}\r\n{code}\r\nalloy.js\r\n{code}Attach in the text file{code}\r\n\r\nNote: Also I have added the full project on the attachment file.\r\n*Error:*\r\n{code}\r\n[ERROR] : Script Error {\r\n[ERROR] : column = 24;\r\n[ERROR] : line = 119;\r\n[ERROR] : message = \"Cannot remove an observer for the key path \\\"url\\\" from because it is not registered as an observer.\";\r\n[ERROR] : }\r\n{code}\r\nIn this test code customer used *media* in the create command to play a video stored on the local device. If they put a fake url in the create it won't throw the error but even though they set the media later then it will not play the video. Again, this only happens on iOS. \r\n\r\nThanks", "attachment": [ { "id": "65157", "filename": "alloy.js", "author": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2018-05-14T16:35:59.000+0000", "size": 1696, "mimeType": "application/javascript" }, { "id": "65158", "filename": "hypertest.zip", "author": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2018-05-14T17:08:32.000+0000", "size": 9209344, "mimeType": "application/zip" } ], "flagged": false, "summary": "iOS: Ti.Media.VideoPlayer shows an error on Window Close on SDK 7.1.1.GA", "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": "Ti.Media.VideoPlayer, iOS", "closedSprints": [ { "id": 1034, "state": "closed", "name": "2018 Sprint 10 SDK", "startDate": "2018-05-07T00:03:21.636Z", "endDate": "2018-05-21T00:03:00.000Z", "completeDate": "2018-05-20T20:54:58.928Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "437642", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "This issue is invalid. The VideoPlayer does not support the {{media}} property and passing {{e.media}} from the video-picker dialog is also not allowed, since it's a Ti.Blob instance, not an actual URL. Please pass the {{nativePath}} of the media to the {{url}} property and see if that works.\r\n\r\nAlso, the Alloy-based app is hard to debug, so a minimalistic app.js test-case (no styling and external layout config) would help cracking it down in case the above still does not work.\r\n\r\n*EDIT*: It seems like the {{media}} property indeed is supported, although not supported. I would still like to know if passing the native-path of the Blob resolves it already and request the app.js test case (from support).", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-05-15T13:11:42.000+0000", "updated": "2018-05-15T13:13:29.000+0000" }, { "id": "437829", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR - https://github.com/appcelerator/titanium_mobile/pull/10071\r\n\r\nTest Case 1 (with url) -\r\n\r\n{code:java}\r\nvar win = Ti.UI.createWindow({\r\n\ttitle : 'Starting Window',\r\n\tbackgroundColor: 'white'\r\n});\r\n\r\nvar openLabel = Ti.UI.createLabel({\r\n\ttext : \"Open Video Window\",\r\n});\r\n\r\nopenLabel.addEventListener('click', function(e) {\r\n\tvideoWin.open();\r\n});\r\n\r\nvar videoWin = Ti.UI.createWindow({\r\n\ttitle : 'Video window',\r\n\tbackgroundColor : '#a5a5a5'\r\n});\r\n\r\nvar activeMovie = null;\r\nvar playLabel = Ti.UI.createLabel({\r\n\ttext : \"Play the video file\",\r\n\ttop : 200,\r\n});\r\nplayLabel.addEventListener('click', function(e) {\r\n\tactiveMovie = Titanium.Media.createVideoPlayer({\r\n\t\ttop : 100,\r\n\t\twidth : Ti.UI.FILL,\r\n\t\tbottom : 200,\r\n\t\tvisible : true,\r\n\t\tzIndex : 999999,\r\n\t\tmediaControlStyle : Titanium.Media.VIDEO_CONTROL_DEFAULT,\r\n\t\tscalingMode : Titanium.Media.VIDEO_SCALING_ASPECT_FILL,\r\n\t\tautoplay : true,\r\n\t\televation : 24,\r\n\t\turl : 'https://www.w3schools.com/html/mov_bbb.mp4'\r\n\t});\r\n\tvideoWin.add(activeMovie);\r\n});\r\nvideoWin.add(playLabel);\r\n\r\nvar closeLabel = Ti.UI.createLabel({\r\n\ttext : \"Close Video Window\",\r\n\tbottom : 100,\r\n});\r\ncloseLabel.addEventListener('click', function(e) {\r\n\tif (activeMovie != null) {\r\n\t\tactiveMovie.release();\r\n\t\twin.remove(activeMovie);\r\n\t}\r\n\tactiveMovie = null;\r\n\tvideoWin.close();\r\n});\r\nvideoWin.add(closeLabel);\r\n\r\nwin.add(openLabel);\r\nwin.open(); \r\n{code}\r\n\r\nTest Case 2 - \r\n\r\n{code:java}\r\nvar win = Ti.UI.createWindow({\r\n\ttitle : 'Starting Window',\r\n\tbackgroundColor: 'white'\r\n});\r\nvar videoWindow = Ti.UI.createLabel({\r\n\ttop : 300,\r\n\ttext : 'open video window'\r\n});\r\nvideoWindow.addEventListener('click', function(e) {\r\n\tvar videoWin = Ti.UI.createWindow({\r\n\t\ttitle : 'Video window',\r\n\t\tbackgroundColor : '#a5a5a5'\r\n\t});\r\n \r\n\tvar videoFile = Titanium.Filesystem.getFile(Titanium.Filesystem.getApplicationDataDirectory(), 'Local_Ad_Video_File_1.MOV');\r\n \r\n\tvar saveLabel = Ti.UI.createLabel({\r\n\t\ttext : \"Save a video file\",\r\n\t\ttop : 200,\r\n\t});\r\n\tsaveLabel.addEventListener('click', function(e) {\r\n\t\tTi.Media.showCamera({\r\n\t\t\tmediaTypes : [Ti.Media.MEDIA_TYPE_VIDEO],\r\n\t\t\tvideoMaximumDuration : 300000,\r\n\t\t\tvideoQuality : Titanium.Media.QUALITY_MEDIUM,\r\n\t\t\tsaveToPhotoGallery : true,\r\n\t\t\tallowEditing : false,\r\n\t\t\tsuccess : function(e) {\r\n\t\t\t\tsaveVideoLocal(e.media);\r\n\t\t\t}\r\n\t\t});\r\n\t\tsaveLabel.hide();\r\n\t\tplayLabel.show();\r\n\t});\r\n\tfunction saveVideoLocal(media) {\r\n\t\tvideoFile.write(media);\r\n\t}\r\n \r\n \r\n\tvideoWin.add(saveLabel);\r\n \r\n\tvar activeMovie = null;\r\n\tvar playLabel = Ti.UI.createLabel({\r\n\t\ttext : \"Play the video file\",\r\n\t\ttop : 200,\r\n\t\tvisible : false\r\n\t});\r\n\tplayLabel.addEventListener('click', function(e) {\r\n\t\tactiveMovie = Titanium.Media.createVideoPlayer({\r\n\t\t\ttop : 100,\r\n\t\t\twidth : Ti.UI.FILL,\r\n\t\t\tbottom : 200,\r\n\t\t\tvisible : true,\r\n\t\t\tzIndex : 999999,\r\n\t\t\tmediaControlStyle : Titanium.Media.VIDEO_CONTROL_DEFAULT,\r\n\t\t\tscalingMode : Titanium.Media.VIDEO_SCALING_ASPECT_FILL,\r\n\t\t\tautoplay : true,\r\n\t\t\televation : 24,\r\n\t\t\turl : videoFile.nativePath\r\n\t\t});\r\n\t\tvideoWin.add(activeMovie);\r\n\t\tcloseLabel.show();\r\n\t});\r\n\tvideoWin.add(playLabel);\r\n \r\n\tvar closeLabel = Ti.UI.createLabel({\r\n\t\ttext : \"Close Video Window\",\r\n\t\tbottom : 100,\r\n\t\tvisible : false\r\n\t});\r\n\tcloseLabel.addEventListener('click', function(e) {\r\n\t\tif (activeMovie != null) {\r\n \r\n\t\t\t// THIS IS THE LINE THAT THROWS THE ERROR. Now in the docs it says:\r\n\t\t\t//Releases the internal video resources immediately.\r\n\t\t\t// This is not usually necessary but can help if you no longer need to use the player after it is used to help converse memory.\r\n\t\t\t// It also says android 0.9 and iOS 0.9 but it is throwing the following error on iOS:\r\n\t\t\t/*\r\n \r\n\t\t\t[ERROR] Script Error {\r\n\t\t\t[ERROR] column = 23;\r\n\t\t\t[ERROR] line = 97;\r\n\t\t\t[ERROR] message = \"Cannot remove an observer for the key path \\\"url\\\" from because it is not registered\r\n\t\t\tas an observer.\";\r\n\t\t\t[ERROR] }\r\n \r\n\t\t\t*/\r\n\t\t\t// On iOS: if I comment out the release line below it will not throw the error but documentation says it can help conserve memory if used.\r\n \r\n\t\t\tactiveMovie.release();\r\n \r\n\t\t\twin.remove(activeMovie);\r\n\t\t}\r\n\t\tactiveMovie = null;\r\n\t\tvideoWin.close();\r\n\t});\r\n\tvideoWin.add(closeLabel);\r\n \r\n\tvideoWin.open();\r\n});\r\nwin.add(videoWindow);\r\nwin.open(); \r\n{code}", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-05-22T05:12:43.000+0000", "updated": "2018-05-22T09:29:12.000+0000" }, { "id": "438603", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "*Closing ticket.* fix can be seen in SDK Version: {{7.3.0.v20180618182516}}\r\n\r\n*FR (Passed) Test Steps:*\r\n# Created an application with the first test case\r\n# Ran the application \r\n# Open the video window\r\n# Let the video play \r\n# Closed the video window \r\n# *Application no longer showed an error*\r\n# Created a new application with the second test case\r\n# Ran the program\r\n# Pressed the {{Open video window}} button\r\n# Pressed the {{Save a video file}} button then pressed {{Play a video file}} button\r\n# Closed the video window \r\n# *Application no longer showed an error*\r\n\r\n*Test Environment*\r\n{code:java}\r\nAPPC Studio: 5.0.0.201712081732\r\nAPPC CLI: 7.0.4\r\niphone 6 11.2 emulator\r\nOperating System Name: Mac OS High Sierra\r\nOperating System Version: 10.13\r\nNode.js Version: 8.9.1\r\nXcode 9.2\r\n{code}\r\n", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-06-21T18:05:09.000+0000", "updated": "2018-06-21T18:05:09.000+0000" } ], "maxResults": 12, "total": 12, "startAt": 0 } } }