I believe it’s good UX to allow the user to preview their media files before uploading them to a server. This is for both audio and video files. Coming from the last tutorial where we previewed an MP3 file, you will notice a lot of the code here is very similar. Previewing a selected video file in an HTML5 video element is VERY similar to previewing a selected audio file in an HTML5 audio element. Both make use of the modern elements.
Featured SubjectsSee all →
Free CoursesView all courses →
The next few tutorials will help build the user experience of your file upload system with Axios and VueJS. This tutorial is specifically focuses on previewing and setting an audio file before allowing the user to upload it. Using this method allows the user to preview what their audio file sounds like before they upload the file to the server to ensure they have the right file.
This tutorial is going to assume you’ve followed along with the series thus far, specifically “Uploading Files With VueJS and Axios“. A lot of the methods are going to look the same and function the same way. We will be building a simple VueJS component that allows the user to select an audio file and preview the file before sending it to the server.
Ever want to save your HTML5 canvas element as an image? You totally can! I’ve done this a few times to solve a variety of different issues. With this trick you can capture a screenshot from a video, save a rendered graphic, pretty much anything within the canvas element.
So we covered the basics in “Beginning Vuex 4 with Vue 3“, but if you are building a larger app, you might have already run into some issues. Or maybe you started thinking, there has to be a better way? When you start building state in larger applications, complex forms, or individual pages that could be an app themselves, you will end up wanting to store more and more in the state. There are a ton of advanced Vuex 4 practices that can help make this process even easier. Now that we have gotten our feet wet with Vuex, let’s jump into some more of the advanced Vuex 4 use cases and some other awesome features of the state management system!
If you haven’t used InertiaJS before, I’d highly recommend checking it out. It allows you to put together an app in no time at all, saves the headache of structuring an SPA if you don’t need it, and allows you to use VueJS (or other popular frontend frameworks) as your templating engine. And of course, you can actually use Vuex with InertiaJS fairly easily. We actually use InertiaJS with Vuex in Financial Freedom, our self hosted budgeting app and it works great!