Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-1049] thumbnailImageAtTime does not work for video player

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionInvalid
Resolution Date2011-04-15T02:42:33.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.4.0
ComponentsiOS
Labelsn/a
ReporterNolan Wright
AssigneeBlain Hamon
Created2011-04-15T02:42:32.000+0000
Updated2017-03-02T19:21:25.000+0000

Description

http://helpdesk.appcelerator.net/tickets/2799">http://helpdesk.appcelerator.net/tickets/2799

code:


var video_full_path = Titanium.Filesystem.resourcesDirectory + '/content/sample_movie.mp4';


var thumbnail_button = Titanium.UI.createButton({ title: 'Gen Thumbnail', top: 200, height:32, width:160 });


thumbnail_button.addEventListener ('click', function() { var recent_vid = Titanium.Media.createVideoPlayer({ contentURL: video_full_path });


Ti.API.info ("File: " + video_full_path); Ti.API.info ("Duration: " + recent_vid.duration); Ti.API.info ("Generating thumbnail..."); var thumbnail = recent_vid.thumbnailImageAtTime (2, Titanium.Media.VIDEO_TIME_OPTION_EXACT); Ti.API.info ("Done generating thumbnail!"); });


win.add (thumbnail_button);


var play_button = Titanium.UI.createButton({ title: 'Play Video', top: 100, height:32, width:160 });


play_button.addEventListener ('click', function() { var recent_vid = Titanium.Media.createVideoPlayer({ contentURL: video_full_path });


Ti.API.info ("Playing " + video_full_path); Ti.API.info ("Duration: " + recent_vid.duration);


recent_vid.play(); });


win.add (play_button);

Comments

  1. Stephen Tramer 2011-04-15

    Modified JS that proves this is not the issue:

       var win = Ti.UI.createWindow({backgroundColor:'white'});
       
       var video_full_path = 'movie.mp4';
       
       var thumbnail_button = Titanium.UI.createButton({ 
       title: 'Gen Thumbnail', 
       top: 200, 
       height:32, 
       width:160 
       });
       
       thumbnail_button.addEventListener ('click', function() 
       { 
       var recent_vid = Titanium.Media.createVideoPlayer({ 
       contentURL: video_full_path 
       }); 
       
       Ti.API.info ("File: " + video_full_path); 
       Ti.API.info ("Duration: " + recent_vid.duration); 
       Ti.API.info ("Generating thumbnail..."); 
       var thumbnail = recent_vid.thumbnailImageAtTime (2, Titanium.Media.VIDEO_TIME_OPTION_EXACT); 
       Ti.API.info ("Done generating thumbnail: "+thumbnail); 
       win.add(Ti.UI.createImageView({
           image:thumbnail,
           bottom:10,
           height:100,
           width:100
       }));
       });
       
       win.add (thumbnail_button);
       
       var play_button = Titanium.UI.createButton({ 
       title: 'Play Video', 
       top: 100, 
       height:32, 
       width:160 
       });
       
       play_button.addEventListener ('click', function() 
       { 
       var recent_vid = Titanium.Media.createVideoPlayer({ 
       contentURL: video_full_path 
       }); 
       
       Ti.API.info ("Playing " + video_full_path); 
       Ti.API.info ("Duration: " + recent_vid.duration);
       win.add(recent_vid);
       recent_vid.play(); 
       });
       
       win.add (play_button);
       win.open();
       

    Problem could be the video path, or the movie type not being supported under iPhone.

  2. Jeff Haynie 2011-04-15

    (from [a0a0e6883432d1a0745764ac15a49a0045a96d43]) [#1049 state:invalid] Added thumbnail image to Phone -> Play Movie -> Embedded to test #1049 and thumbnail generation in general. http://github.com/appcelerator/titanium_mobile/commit/a0a0e6883432d1a0745764ac15a49a0045a96d43"> http://github.com/appcelerator/titanium_mobile/commit/a0a0e6883432d...

  3. Stephen Tramer 2011-04-15

    Okay, this was broken in 1.3.0 - it must've been fixed when I did #1044.

  4. Lee Morris 2017-03-02

    Closed as invalid.

JSON Source