[AC-5340] iOS Titanium.Media.VideoPlayer setUrl not working on SDK 6.x
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Resolved |
Resolution | Needs more info |
Resolution Date | 2017-11-07T16:05:19.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | n/a |
Labels | n/a |
Reporter | Henry Orozco |
Assignee | Shak Hossain |
Created | 2017-11-02T18:55:29.000+0000 |
Updated | 2017-11-08T21:08:25.000+0000 |
Description
Titanium.Media.VideoPlayer setUrl(url) works fine the first time, but the second time after setting another url setUrl(otherUrl), starts playing the first url set, if I execute getUrl() it returns the second url, but it is actually playing the first url set.
// index.js
var videoPlayer = Titanium.Media.createVideoPlayer({
top : 0,
visible: false,
autoplay: true,
mediaControlStyle : Ti.Media.VIDEO_CONTROL_NONE,
scalingMode : Ti.Media.VIDEO_SCALING_ASPECT_FIT
});
function playOne(e) {
videoPlayer.setUrl('http://nadikun.com/audio/pink-shades-o-pnr.mp3');
videoPlayer.play();
}
function playTwo(e) {
videoPlayer.stop();
// the issue is here, even though I am setting another URL still plays the previous URL set
videoPlayer.setUrl('http://nadikun.com/audio/suit-and-tie-oscar-wylde-remix.mp3');
videoPlayer.play();
}
function stop(e) {
videoPlayer.stop();
}
function getUrl(e) {
alert('videoPlayer.getUrl(): ' + videoPlayer.getUrl());
}
$.index.open();
Hello, Please create a full reproducible test code and provide here for us to test the issue. Also, provide detail affected environment. Thanks.
The video-player wasn't touched between 5.x and 6.x, so it has to be something on your end. If not, please try the new video-player being introduced in SDK 7.0 as part of TIMOB-19040
full reproducible test code added.