public Media(String URI, int position) { mLocation = URI; LibVLC mLibVlc = null; try { mLibVlc = LibVLC.getInstance(); mType = TYPE_ALL; TrackInfo[] tracks = mLibVlc.readTracksInfoPosition(position); extractTrackInfo(tracks); } catch (LibVlcException e) { e.printStackTrace(); } }
public String[] getMediaOptions(int position) { boolean noHardwareAcceleration = false; boolean noVideo = false; if (isValid(position)) { noHardwareAcceleration = mInternalList.get(position).noHardwareAcceleration; noVideo = mInternalList.get(position).noVideo; } return mLibVLC.getMediaOptions(noHardwareAcceleration, noVideo); }
/** * Create a new Media * * @param context Application context of the caller * @param media URI * @param addToDb Should it be added to the file database? */ public Media(String URI, Boolean addToDb) { mLocation = URI; LibVLC mLibVlc = null; try { mLibVlc = LibVLC.getInstance(); mType = TYPE_ALL; TrackInfo[] tracks = mLibVlc.readTracksInfo(mLocation); extractTrackInfo(tracks); } catch (LibVlcException e) { e.printStackTrace(); } if (addToDb) { // Add this item to database DatabaseManager db = DatabaseManager.getInstance(VLCApplication.getAppContext()); db.addMedia(this); } }