-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enable video thumbnail #1035
enable video thumbnail #1035
Conversation
Update: on server side ffmpgthumbnailer is not needed, but: |
PR for #897 |
|
||
String url = ((File) mFile).getAbsolutePath(); | ||
FileNameMap fileNameMap = URLConnection.getFileNameMap(); | ||
String mMimeType = fileNameMap.getContentTypeFor("file://" + url); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, use FileStorageUtils.getMimeTypeFromExtension(...)
instead. That way we avoid introducing java.net.URLConnection
in the imports. Let's prevent the temptation of using other network libraries.
The 'play' PNG seems very small for high resolution screens. |
Bitmap playButton = BitmapFactory.decodeResource(MainApp.getAppContext().getResources(), | ||
R.drawable.view_play); | ||
|
||
Bitmap resizedPlayButton = Bitmap.createScaledBitmap(playButton, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thumbnails are saved always with the same resolution in a given device, right? In that case, the scaled load of the 'play' image and the calculation for its coordinates should be done only once, and kept in static fields.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since I added resolution dependent play icons for all sizes the scaling shouldn't be needed anymore and the icon should be sharp on all device sizes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem is that I need the exact coordinates of the three points forming the triangle to compute the exact visual center of the play button (which is not the center of the image).
So therefore I had modified the original image and cropped all outer space of the play button.
If we do this on all play buttons, I guess it is working.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AndyScherzinger can I crop the images?
Scaling (or at least resizing) is still necessary as the visual center of the play button is not the center of the image.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tobiasKaminsky sure, go ahead. The pngs are the standard ones provided by googles material design icon repository
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thumbnails are saved always with the same resolution in a given device, right? In that case, the scaled load of the 'play' image and the calculation for its coordinates should be done only once, and kept in static fields.
As video thumbnails can occur in file and grid view, the computation must be in this function, as it depends on the thumbnail size.
Reviewed; please, see my comments. |
@davivel and @tobiasKaminsky I just pushed a play icon for all the resolutions in standard 24dp sizes. Hope that is fine with you @tobiasKaminsky me simply committing this to your branch. |
@davivel fixed and added comments to your review |
…_vars Load release signing config from environment variables
reorder issue template
…f public share are updated
Update of build target to Android Nougat, with multiwindow
Adapt to new OC_Log.startLogging(...) with path parameter
Dear friends @owncloud/android-developers, this branch needs a rebase with master. Does everybody volunteer? :) |
To prevent tapjacking like attacks we should explicitly enable this attribute. Fore more details see https://blog.lookout.com/look-10-007-tapjacking/ Note that this does not affect all Android devices as for example Samsung started with Ice Cream to mitigate this issue on OS level. To test this I can recommend the https://github.com/mwrlabs/tapjacking-poc application.
Add `android:filterTouchesWhenObscured`
I'll do it, @jesmrec . |
removed empty image parts
e9bf119
to
7068445
Compare
Rebased; replacing with a new PR to master |
Requires ffmpeg and ffmpegthumbnailer on server.