Titanium JIRA Archive
Appcelerator Community (AC)

[AC-4552] Ti.Media.VideoPlayer not rendering thumbnail on Android for local file

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionCannot Reproduce
Resolution Date2016-11-15T19:14:04.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsn/a
ReporterMike Neill
AssigneeShak Hossain
Created2016-10-13T11:02:44.000+0000
Updated2016-11-15T19:14:04.000+0000

Description

I am using the Ti.Media.VideoPlayer to create a thumbnail using the code below. This code works perfectly on iOS, but on Android it does not. I believe the issue is because I am trying to load a local file that resides in the application's data directory (E.g. file:///data/user/0/com.mydomain.app/app_appdata/1476356057.mp4). The code below works correctly when I use a remote URL to an online video file such as "Big Buck Bunny". Can you please help me realize what is going on with my implementation? var mp4 = [Ti.File object] var movie = Ti.Media.createVideoPlayer({ autoplay : false }); movie.url = mp4.getNativePath(); movie.requestThumbnailImagesAtTimes([1, 2, 3, 4], (OS_IOS) ? Ti.Media.VIDEO_TIME_OPTION_EXACT : Ti.Media.VIDEO_TIME_OPTION_NEAREST_KEYFRAME, function(e) { // Do fun stuff... }); *Expected Result:* Request completes and returns object with thumbnail path. *Actual Result:* The request never completes. Not even an error is thrown.

Comments

  1. Mike Neill 2016-10-13

    Here is an example JSON printout of the mp4 file object in the above example. {"hidden":false,"nativePath":"file:///data/user/0/com.uoovoice.uoovoice/app_appdata/1476356057.mp4","writable":true,"executable":false,"parent":{"hidden":false,"nativePath":"file:///data/user/0/com.uoovoice.uoovoice/app_appdata","writable":true,"executable":false,"parent":{"hidden":false,"nativePath":"file:///data/user/0/com.uoovoice.uoovoice","writable":true,"executable":false,"parent":{"hidden":false,"nativePath":"file:///data/user/0","writable":false,"executable":false,"parent":{"hidden":false,"nativePath":"file:///data/user","writable":false,"executable":false,"parent":{"hidden":false,"nativePath":"file:///data","writable":false,"executable":false,"parent":{"hidden":false,"nativePath":"file:///","writable":false,"executable":false,"parent":null,"readonly":true,"directoryListing":["vendor","firmware","persist","sdcard","storage","mnt","config","cache","acct","d","etc","verity_key","ueventd.rc","ueventd.bullhead.rc","system","sys","service_contexts","sepolicy","selinux_version","seapp_contexts","sbin","res","property_contexts","proc","oem","init.zygote64_32.rc","init.zygote32.rc","init.usb.rc","init.usb.configfs.rc","init.trace.rc","init.rc","init.environ.rc","init.bullhead.usb.rc","init.bullhead.sensorhub.rc","init.bullhead.rc","init.bullhead.ramdump.rc","init.bullhead.misc.rc","init.bullhead.fp.rc","init.bullhead.diag.rc","init","fstab.bullhead","file_contexts","default.prop","data","charger","root","dev"],"size":0,"apiName":"Ti.Proxy","name":"","symbolicLink":false,"bubbleParent":true},"readonly":false,"directoryListing":[],"size":4096,"apiName":"Ti.Proxy","name":"data","symbolicLink":false,"bubbleParent":true},"readonly":false,"directoryListing":[],"size":4096,"apiName":"Ti.Proxy","name":"user","symbolicLink":false,"bubbleParent":true},"readonly":false,"directoryListing":[],"size":8192,"apiName":"Ti.Proxy","name":"0","symbolicLink":false,"bubbleParent":true},"readonly":false,"directoryListing":["lib","cache","code_cache","databases","app_sslcache","app_Parse","app_appdata","shared_prefs"],"size":4096,"apiName":"Ti.Proxy","name":"com.uoovoice.uoovoice","symbolicLink":false,"bubbleParent":true},"readonly":false,"directoryListing":[".tilicense","1476176388.jpg","9f84c270461f0b8e8523e561026b306a_media.jpeg","1476262304.jpg","4bc79d197d4462dfed5b5b3d0ec1c2ab_media.jpeg","1476268395.mp4","tia1476348844762.jpg","1476351679","6266a04cffd14335ba8dabbb550df066_media.jpeg","tia1476348863486.mp4","1476348863.mov","ad8fab0b46049aa745fd3e0a47b7c865_media.jpeg","tia1476348997658.mp4","1476348998.mov","tia1476349201160.mp4","tia1476349564725.mp4","1476349564.mp4","tia1476350061684.mp4","1476350061.mov","tia1476350496590.mp4","1476350496.mov","tia1476350811745.mp4","1476350811.mp4","tia1476350944249.mp4","1476350944.mp4","tia1476351084985.mp4","1476351085.mp4","tia1476351227354.mp4","1476351227.mp4","tia1476351481737.mp4","1476351482.mp4","tia1476351667600.mp4","1476351668.mp4","tia1476351804993.mp4","1476351805.mp4","1476355293.mp4","87ed01ab5e7790c9b6b8b4c0ec6d3d43_media.mp4","d983ca47854fa05fd636ac8859a048f7_media.jpeg","tia1476355293619.mp4","tia1476355550778.mp4","1476355550.mp4","tia1476355699761.mp4","1476355700.mp4","tia1476355915743.mp4","1476355915.mp4","tia1476356057350.mp4","1476356057.mp4"],"size":4096,"apiName":"Ti.Proxy","name":"app_appdata","symbolicLink":false,"bubbleParent":true},"readonly":false,"directoryListing":[],"size":3027991,"apiName":"Ti.Filesystem.File","name":"1476356057.mp4","symbolicLink":false,"bubbleParent":true}
  2. Sharif AbuDarda 2016-11-09

    Hello, Can you provide more details, With the below code I can verify the callback function is called with the define time. I am not able to reproduce the issue in Android.
       var vidWin = Titanium.UI.createWindow({
           title : 'Video View Demo',
           backgroundColor : '#fff'
       });
       
       var videoPlayer = Titanium.Media.createVideoPlayer({
           top : 2,
           autoplay : true,
           backgroundColor : 'blue',
           height : 300,
           width : 300,
           mediaControlStyle : Titanium.Media.VIDEO_CONTROL_DEFAULT,
           scalingMode : Titanium.Media.VIDEO_SCALING_ASPECT_FIT
       });
       
       videoPlayer.url = 'bigbuckbunny.mp4';
       
       videoPlayer.requestThumbnailImagesAtTimes([0, 1, 5, 6, 7], Titanium.Media.VIDEO_TIME_OPTION_NEAREST_KEYFRAME, function(response) {
       
           Ti.API.info("Thumbnail callback called, success");
       
       
       });
       
       vidWin.add(videoPlayer);
       vidWin.open();
       

JSON Source