{ "id": "139957", "key": "TIMOB-18055", "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": null, "resolutiondate": null, "created": "2014-11-18T15:04:41.000+0000", "priority": null, "labels": [ "initialplaybacktime", "ios", "media", "playlist", "videoplayer" ], "versions": [], "issuelinks": [], "assignee": null, "updated": "2018-02-28T19:55:06.000+0000", "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" } }, "components": [ { "id": "10224", "name": "TiAPI", "description": "This component is used for cross-platform API work. Specifications are most likely to use this component." } ], "description": "Hello,\r\n\r\nI am using a playlist to simulate some kind of Live-TV.\r\nWhen the user initially opens the window and plays the video, the initialplaybacktime is set correctly of the video. \r\n\r\nThen if the user stops the video by clicking on it (Looks like it's being paused but actually it's stopped ($.video.stop()) to reload the playlist and get the live elapsed time) and then clicks it again.\r\n\r\nWhen the user clicks it after it's stopped, the playlist is reloaded and the current video is set as url and it's elapsed time is set with setInitialPlaybackTime().\r\n\r\nBut this doesn't work, and it results into a 'NaN' if I try to retrieve it the playback has started the second time, so not the initial time the user opens the window.\r\n\r\nh4. Testcase\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n exitOnClose: true,\r\n layout: 'vertical'\r\n});\r\n\r\nvar url = \"http://clips.vorwaerts-gmbh.de/VfE_html5.mp4\";\r\n\r\nvar videoPlayer = Ti.Media.createVideoPlayer({\r\n top: 0,\r\n scalingMode: Ti.Media.VIDEO_SCALING_ASPECT_FIT,\r\n autoplay: false,\r\n width: Ti.Platform.displayCaps.platformWidth,\r\n height: Ti.Platform.displayCaps.platformWidth * (9/16), // 16:9 ratio on the screen\r\n fullscreen: false,\r\n mediaControlStyle: Ti.Media.VIDEO_CONTROL_NONE\r\n});\r\nvideoPlayer.addEventListener('playbackstate', function(e) {\r\n if(e.playbackState == Ti.Media.VIDEO_PLAYBACK_STATE_PLAYING) {\r\n btn.title = \"Stop\";\r\n Ti.API.info(\"Initial playback videoPlayer on state change: \"+this.getInitialPlaybackTime());\r\n Ti.API.info(\"Current playback videoPlayer on state change: \"+this.getCurrentPlaybackTime());\r\n } else if(e.playbackState == Ti.Media.VIDEO_PLAYBACK_STATE_STOPPED) {\r\n btn.title = \"Play\";\r\n }\r\n});\r\nwin.add(videoPlayer);\r\n\r\nvar btn = Ti.UI.createButton({\r\n top: 20,\r\n width: \"60%\",\r\n height: 40,\r\n title: \"Play\"\r\n});\r\nbtn.addEventListener(\"click\", function() {\r\n if(videoPlayer.playbackState == Ti.Media.VIDEO_PLAYBACK_STATE_PLAYING) {\r\n videoPlayer.stop();\r\n videoPlayer.url = \"\";\r\n } else {\r\n var initialPlayback = Math.floor((Math.random() * 10000) + 1000); // random initial\r\n Ti.API.info(\"Initial playback: \"+initialPlayback);\r\n Ti.API.info(\"Initial playback videoPlayer on click: \"+videoPlayer.getInitialPlaybackTime());\r\n Ti.API.info(\"Current playback videoPlayer on click: \"+videoPlayer.getCurrentPlaybackTime());\r\n videoPlayer.setInitialPlaybackTime(initialPlayback);\r\n videoPlayer.setUrl(url);\r\n videoPlayer.play();\r\n }\r\n});\r\nwin.add(btn);\r\nwin.open();\r\n{code}\r\n\r\nThis code exactly shows in the logs that it does not work.\r\n\r\nRegards,\r\nPatrick van Vuuren", "attachment": [], "flagged": false, "summary": "Titanium VideoPlayer initialPlaybackTime setting does not work for second video in VideoPlayer", "creator": { "name": "Serfenia", "key": "serfenia", "displayName": "Patrick van Vuuren", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "Serfenia", "key": "serfenia", "displayName": "Patrick van Vuuren", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "iOS 8.1", "comment": { "comments": [ { "id": "332846", "author": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "body": "Problem can be reproduced on iOS 8.1, SDK 3.4.0", "updateAuthor": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "created": "2014-11-19T02:58:33.000+0000", "updated": "2014-11-19T02:58:33.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }