-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
[WIP] Added audio player #2432
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
base: master
Are you sure you want to change the base?
[WIP] Added audio player #2432
Conversation
| * @returns {String} Generated markdown code | ||
| */ | ||
| function generateAttachmentMarkdown (fileName, path, showPreview) { | ||
| return `${showPreview ? '!' : ''}[${fileName}](${path})` |
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.
why did you remove the parameter (and evaluation) ´showPreview´????
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.
I'm sorry, I'll fix it right away 😄
| } else if (fileType.startsWith('audio')) { | ||
| previewType = 'audio' | ||
| } | ||
| const imageMd = generateAttachmentMarkdown(originalFileName, path.join(STORAGE_FOLDER_PLACEHOLDER, noteKey, fileName), previewType) |
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.
you've modified the previewGeneration on this place as well!
| const imageMd = generateAttachmentMarkdown(originalFileName, path.join(STORAGE_FOLDER_PLACEHOLDER, noteKey, fileName), showPreview) | ||
| let previewType = null | ||
| if (fileType.startsWith('image')) { | ||
| previewType = '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.
maybe you should use constants istead of strings for this!
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.
Good idea!
|
@ZeroX-DG I would recommend a syntax close to the one for images. For example: would be rendered as This way, we can have references: or simply Same for video: rendered as |
|
@daiyam Thank you for your suggestion, I'm also thinking about the syntax for this and your suggestion looks great! |
|
I just recalled vaguely there have been PR's for audio player and slide show so I wondered if they've been released yet. |
|
@arcturus140 that's a great idea, I'll add it to the welcome page. The slideshow was actually by @daiyam at #2465 |
|
@daiyam I used |
|
@ZeroX-DG |
I think that # will be confusing in md for most people because it is related with header. But yeah bomb the slack channel about this. |
The audio player is here!
To add an audio player to your note your note must obey these rules:
The audio syntax will automatically be generated when you drag the audio file in.
Enough talking! Demo: