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

Mic icon change. #2

Open
ameerzulkarnain opened this issue Dec 6, 2019 · 15 comments
Open

Mic icon change. #2

ameerzulkarnain opened this issue Dec 6, 2019 · 15 comments
Assignees
Labels
enhancement New feature or request question Further information is requested

Comments

@ameerzulkarnain
Copy link

Is it possible to change the green microphone icon?

@b4dnewz b4dnewz added the question Further information is requested label Dec 7, 2019
@b4dnewz b4dnewz self-assigned this Dec 7, 2019
@b4dnewz
Copy link
Member

b4dnewz commented Dec 7, 2019

no, unfortunately right now is not possible but is one features I will like to add to this module, but require some changes.

I would like to replace the actual icon which is created by css with a SVG icon optionally customizable or fully replaceable.

@b4dnewz
Copy link
Member

b4dnewz commented Dec 7, 2019

at the moment, you can try to override the css code which create the icon, this is the relevant code:
https://github.com/codekraft-studio/vue-record/blob/master/src/components/VueRecordAudio.vue#L70-L120

@ameerzulkarnain
Copy link
Author

Hi. Thank you for your suggestion. Will look into it

@ameerzulkarnain
Copy link
Author

@b4dnewz One more question, on the demo page, why is it when I click download, the download file was a .txt file. Can I know the exact mimetype of the audio file.

@b4dnewz
Copy link
Member

b4dnewz commented Dec 10, 2019

it's a html5 thing, since iny demo code I didn't specified the source type on audio element as described in the mdn documentation I guess is just trying to guess the download file type

In the demo page I literally put less effort as possible since is only demonstrative

@b4dnewz
Copy link
Member

b4dnewz commented Dec 20, 2019

A few updates, after months that I've been using mdi icons I just discovered it offers SVG code for every icons.

So I can just grab the desired icons from there and embed them in the plugin as default icons, benefit of svg is that the icons can be deeply customized then.

When I've some spare time I'll do this.

@b4dnewz b4dnewz added the enhancement New feature or request label Dec 20, 2019
@ameerzulkarnain
Copy link
Author

Yes. Currently I mod the code to use SVG icon. On other notes, I notice that this package uses MediaRecorder which supports audio/webm mimetype. However, after recording I notice that it recorded the audio as video/webm. It can be played no error on that but I cannot read its total time by using html tag

@b4dnewz
Copy link
Member

b4dnewz commented Dec 27, 2019

mm.. I didn't understand exactly what you mean by it:

However, after recording I notice that it recorded the audio as video/webm. It can be played no error on that but I cannot read its total time by using html tag

If you provide some code or describe further the problem maybe I can help.

@ameerzulkarnain
Copy link
Author

After a few research on that, it was actually a chrome bug with MediaRecorder. It will produce a file with mimetype video/webm with no metadata. That's why I cant have the audio duration. If I was using firefox it was working fine because it produces a audio/ogg file.

Reference: https://air.ghost.io/recording-to-an-audio-file-using-html5-and-js/
Look for the issues segment

@b4dnewz
Copy link
Member

b4dnewz commented Dec 28, 2019

actually you can customize what mime type you want with props, it's not documented but there is if that help on chrome

the problem with documenting things it's i'm not a native english speaker so it takes me more time to write a understandable and sensible documentation that writing the actual code itself 😄

@ameerzulkarnain
Copy link
Author

No worries. I did trywith props already. However it is only working with Firefox. With Chrome, if I set something else other than webm, it will throw error saying MediaRecorder not supported this format.

So I guess it's just a chrome bug

b4dnewz pushed a commit that referenced this issue Dec 28, 2019
Project structure refactoring, moved library files in dedicated folder to separate them from demo source code
Unified the components base style in separate file and changed base class names
Changed default hardcoded css base icons in favor of fully customizable svg icon or replaceable slot, see #2 for the discussion
@b4dnewz
Copy link
Member

b4dnewz commented Dec 28, 2019

I'm working on the customizable icons, probably tomorrow I will release a beta version with the new features, if you want to help me testing it.

The default icon style is quite different, but I've added a bunch of style related props to customize it in many ways and also a slot to replace the inner icon. I'm not quite sure how to deal with the animation, previously there was a pulse animation but doesn't play well with the customizations since is wrote in css.

Here a screenshot of the beta branch where i'm working on it.

beta_screenshot

@HarrisWebApps
Copy link

HarrisWebApps commented Dec 31, 2019

Nice work Filippo ....If you are not inclined to write your own css for the animated icon...you may want to check out this codepen that animates a mic using the animate.css lib:

Speech to text with Vue and Vuetify using Web SpeechRecognition

Animate CSS @3.5.2

@b4dnewz
Copy link
Member

b4dnewz commented Jan 3, 2020

awesome, @HarrisWebApps I've just checked it and it's exactly what I was looking for, an example of speech recognition which relay on a graphic framework (such as vutify, in this case), it also make me think a possible code refactoring

If you are not inclined to write your own css for the animated icon

Exactly, I'm not a good designer nor very good with styles and I would like to write this plugin as much "general" as possible to let the final users handle their styles and animations as they prefer

As soon as I can I'll write this little refactor and publish a new version

b4dnewz pushed a commit that referenced this issue Jan 12, 2020
See the issue #2 for refactoring discussion
@joaokrabbe
Copy link

Hi @b4dnewz . Great compenent, excelent job, congrats.
I wondering if you have finished this feature "Mic icon change".
And if you could release it on master and npm?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants