Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-14880] iOS: Detect if a remote media url is valid in Ti.Media.videoPlayer

GitHub Issuen/a
TypeNew Feature
PriorityLow
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 3.1.0, Release 3.1.1
Fix Version/sn/a
ComponentsiOS
LabelssupportTeam
ReporterRupesh Sharma
AssigneeUnknown
Created2013-08-14T11:08:27.000+0000
Updated2018-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

Comments

  1. Davide Cassenti 2013-08-16

    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;
       });
       

JSON Source