Skip to content
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

[Feature] View mode: open Image,Video,Audio files in Markor #1806

Merged
merged 9 commits into from
Aug 28, 2022

Conversation

gsantner
Copy link
Owner

@gsantner gsantner commented Aug 20, 2022

View mode: Feature open Image,Video,Audio files and other WebView supported formats in view mode (allow open jpg/mp4/mp3 etc directly in Markor), by @gsantner, closes #1200

  • List of supported filetypes depends on native support by Android OS & WebView, here is a overview of the supported filetypes. This of course includes the most relevant stuff like jpg/png/mp4/mp3/webm..
  • Also added: WebChromeClient => fullscreen video playback. This means also videos embedded in markdown then also have the fullscreen button enabled.
  • Extract generic media information like title/artist/bitrate if possible with builtin Android utility

state 28. august:
screenshot-2022-08-28__16-59-59-embed-binary

state of earliest version: video, image, audio .. and also you can zoom in with zoom gesture 😄 . And yes everything shown is in a webview using html5 video/img tags + file://reference.

3

@gsantner gsantner self-assigned this Aug 20, 2022
@@ -134,12 +138,16 @@ public void onCreate(final Bundle savedInstanceState) {
}
}

public boolean isViewBinary(){
return !(getActivity() instanceof MainActivity);
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes this will move around and have a proper detection, it's just for development currently. And it will only be allowed to show the view mode for such files. Editor text stays empty, as well read/write/saveText disabled.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to encryption hook (that reads/writes files differently than normal text) there is another one now that just returns empty string, or returns true when wanting to write. (=dummy). No relevant other change at fragment or someting thus.

@gsantner gsantner force-pushed the binaryembed branch 6 times, most recently from 1c8d67c to 4af7164 Compare August 21, 2022 13:04
@gsantner
Copy link
Owner Author

gsantner commented Aug 21, 2022

@harshad1
Some peak on this really nice feature, Really nice previewing of filetypes supported by WebView. Note that it not uses any kind of external dependencies or custom UI - it's just Markor's view mode, using the same way templating/converter is used at todo.txt. (just that editor/file-saving is disabled as it's binary). This all also means: User configuration, like Inject->Head, custom CSS, custom JS also applies here.

screenrecord-2022-08-21_15.07.35.webm

I discovered this handy class https://developer.android.com/reference/android/media/MediaMetadataRetriever that can give many different kinds of metadata, really well working. It's also capable of extracting music cover art, or video preview/frame with ~2 lines of code.

What I want to do in future is also to add the outputs of the extraction utility I wrote.... to the existing file-info-dialog. So meaning users get more insights straight from the Markor filebrowser's toolbar info button 😄 .
At the most core it's the addition of EmbedBinaryConverter and the addition of the extractMetadata function to ShareUtil

What do you think?

gsantner added a commit that referenced this pull request Aug 21, 2022
@gsantner gsantner force-pushed the binaryembed branch 5 times, most recently from 9296907 to 2361d5d Compare August 23, 2022 01:46
@gsantner gsantner force-pushed the master branch 7 times, most recently from 108059d to cf80f5c Compare August 23, 2022 02:41
…ported formats in view mode (allow open jpg/mp4/mp3 etc directly in Markor), by @gsantner, closes #1200

fullscreen overlay (video fullscreen playback)

audio, read generic multimedia file metadata like artist,title

view mode button style material-ish

Generic extractFileMetadata --> shareutil

move webchromeclient to net package

optimize/reformat code
@gsantner gsantner force-pushed the binaryembed branch 3 times, most recently from 66e6338 to bf17d51 Compare August 28, 2022 10:36
Copy link
Owner Author

@gsantner gsantner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looked through all files at merge overview looks good

@gsantner gsantner changed the title WIP: [Feature] View mode: open Image,Video,Audio files in Markor [Feature] View mode: open Image,Video,Audio files in Markor Aug 28, 2022
@gsantner gsantner added this to the Markor v2.11 milestone Aug 28, 2022
@gsantner gsantner modified the milestone: Markor v3.0 Aug 28, 2022
@gsantner gsantner merged commit 8a20b60 into master Aug 28, 2022
@gsantner gsantner deleted the binaryembed branch August 28, 2022 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Open media in the Markor app (WebView compatible formats)
1 participant