Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-10830] Android: Ti.Media.VideoPlayer not accepting native path on Android

GitHub Issuen/a
TypeBug
PriorityLow
StatusReopened
ResolutionUnresolved
Affected Version/sRelease 2.1.2
Fix Version/sn/a
ComponentsAndroid
Labelsapi, exalture
ReporterJohan Lundin
AssigneeUnknown
Created2012-09-04T10:12:35.000+0000
Updated2018-02-28T20:03:14.000+0000

Description

On android the video url must be specified as a url and always belongs in the resource folder. The following fix allows it to be consistent with the iphone call where native path can be used. https://github.com/appcelerator/titanium_mobile/blob/2_1_X/android/modules/media/src/java/android/widget/TiVideoView8.java Line 424-426: String path = mUri.toString().substring("file:///android_asset/".length()); afd = getContext().getAssets().openFd(path); mMediaPlayer.setDataSource(afd.getFileDescriptor(), afd.getStartOffset(), afd.getLength()); should be replaced with: String path = mUri.toString().substring("file:///android_asset/".length()); // Needed to handle native path urls path = path.replace("Resources//", "Resources/"); afd = getContext().getAssets().openFd(path); mMediaPlayer.setDataSource(afd.getFileDescriptor(), afd.getStartOffset(), afd.getLength());

Comments

No comments

JSON Source