Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-1373] iOS : videoplayer done button doesn't trigger any eventlistener

GitHub Issuen/a
TypeBug
PriorityTrivial
StatusClosed
ResolutionInvalid
Resolution Date2011-04-15T02:50:41.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsiOS
Labelsios, movie, movieplayer, videoplayer
Reporterzeroendless
AssigneeReggie Seagraves
Created2011-04-15T02:50:39.000+0000
Updated2017-03-09T23:16:59.000+0000

Description

On full screen, the video player used to trigger complete event handler. Now, it does nothing. From the Doc, it says it should trigger the properties "reason"- user existed, but it's not.

http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.Media.VIDEO_FINISH_REASON_USER_EXITED-property.html"> http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.Med....

var win = Titanium.UI.currentWindow;

var contentURL = 'http://movies.apple.com/media/us/ipad/2010/tours/apple-ipad-video-us-20100127_r848-9cie.mov'">http://movies.apple.com/media/us/ipad/2010/tours/apple-ipad-video-u...;
if (Ti.Platform.name == 'android') {
contentURL = "http://c0222252.cdn.cloudfiles.rackspacecloud.com/0032_MotoBlur.m4v";">http://c0222252.cdn.cloudfiles.rackspacecloud.com/0032_MotoBlur.m4v";
} var activeMovie = Titanium.Media.createVideoPlayer({
contentURL: contentURL,
backgroundColor:'#111',
movieControlMode:Titanium.Media.VIDEO_CONTROL_DEFAULT,
scalingMode:Titanium.Media.VIDEO_SCALING_MODE_FILL
});

if (parseFloat(Titanium.Platform.version) >= 3.2)
{ win.add(activeMovie);
}

var windowClosed = false;

activeMovie.addEventListener('complete',function(e)
{ Titanium.UI.createAlertDialog({title:'Movie', message:'click on done?'+e}).show();
});

activeMovie.play();

win.addEventListener('close', function()
{ if (!windowClosed)
{ windowClosed = true;
alert("Window closed!!");
activeMovie.stop();
} });

Comments

  1. Craig Jones 2011-04-15

    I'm also experiencing the same problem.

    Used to work fine in previous version, but since the update the 'Done' button only pauses the movie and doesn't close the window view and return.

    Many thanks

    Craig

  2. Emir Alp 2011-04-15

    I have same issue too. Is there any solution?

  3. Stephen Tramer 2011-04-15

    Apple's documentation specifies that the "done" button does NOT trigger a completion event on the player:

    MPMoviePlayerPlaybackDidFinishNotification ... This notification is not sent in cases where the movie player is displaying in fullscreen mode and the user taps the Done button. In that instance, the Done button causes movie playback to pause while the player transitions out of fullscreen mode. If you want to detect this scenario in your code, you should monitor other notifications such as MPMoviePlayerDidExitFullscreenNotification.

    Listen for 'fullscreen' notification, and check the 'entering' property of the event.

  4. Lee Morris 2017-03-09

    Closing ticket as invalid.

JSON Source