[TIMOB-14880] iOS: Detect if a remote media url is valid in Ti.Media.videoPlayer
| GitHub Issue | n/a |
|---|---|
| Type | New Feature |
| Priority | Low |
| Status | Open |
| Resolution | Unresolved |
| Affected Version/s | Release 3.1.0, Release 3.1.1 |
| Fix Version/s | n/a |
| Components | iOS |
| Labels | supportTeam |
| Reporter | Rupesh Sharma |
| Assignee | Unknown |
| Created | 2013-08-14T11:08:27.000+0000 |
| Updated | 2018-02-28T20:03:25.000+0000 |
Description
Description
When a video url is not available, the video player just shows a spinning activity indicator. We need a way to check if the media is available and to show an error if it is not.Test case
var win = Titanium.UI.createWindow({backgroundColor:"black"});
var activeMovie = Titanium.Media.createVideoPlayer({
url: url
});
win.add(activeMovie);
win.open();
// NEED AN EVENT TO GET THE 404 ERROR
As a workaround, a timeout can be set. The timeout can be canceled by the 'load' event.
var timeout = setTimeout(function() { alert("TIMEOUT ERROR!"); }, 10000); activeMovie.addEventListener('load', function(e){ clearTimeout(timeout); timeout = null; });