Skip to main content

Learn to direct deposit tokens to your MetaMask Login

There is no denying the fact that the primary aim of why one uses MetaMask is to hold and store supported crypto assets. As we know that MetaMask is used to hold ETH or ERC 20 tokens, hence, we should also know the process to do so. However, there are a lot of beginners who are still unaware of the direct deposit process on the MetaMask Login. Hence, I am here with the complete instructional guide which will help you to dump all your crypto purchases into your wallet. To deposit any of the supported assets in your MetaMask Login directly from the exchange where you have purchased it from or from another wallet, you have to take some easy steps. All you need to do is submit a transaction to the MetaMask Login address of one of the wallet accounts where you wish to dump the assets. Another important thing to note down here is that if you are using Coinbase Pay, there is an exclusive feature that can be used to transfer funds instantly. However, this feature is currently available only f

Creating a video player app using React Native framework

If you are on a journey to learning the full utility of React Native framework, you must know the use of the expo-av React Native package in creating a video player app. Here, you will also get the code snippets and the steps of running the project on a virtual device.

So, let’s get into this journey.

Table of Contents

What are the prerequisite criteria?

  • The first criterion that you have to meet is to set up your development system and get all the required software installed in your system. This is a common practice that every developer of React Native app development company engages with before starting off their development journey with the React Native framework.

If you are using the React Native framework for the first time, you should not skip this installation step. However, if this setup is already done in your system, skip this step and start directly with the codebase and third-party React Native package installation.

You have to look for a reliable learning source.

  • The second criterion that you need to consider is to get familiar with the React native components. For this, you have to learn the React Native app-making process. A basic ‘Hello World’ app will meet the criteria. You can find a YouTube tutorial and take help from React Native experts to start working with the React native framework.

Now, we will discuss the utility of expo-av in this project and its installation process.

Installing expo-av package as dependencies

One of the most important reasons behind the increasing use of React Native as a cross-platform app development framework is that it supports third-party libraries. This means you don’t have to create components by yourself but can take the work of the community members and install it in your project. It has not only made the life of developers much easier but has made the React Native community stronger.

In this note, you must use expo-av, a React Native third-party package. To get this package linked to your app, you have to open a terminal from your project folder and execute npx expo install expo-av.

Since we need to create the video player app, you will only need the Video component from expo-av.

Also, if you are working on the Expo CLI and not on bare React Native CLI, you need to install the expo package.

If you are done with installing the third-party dependencies, let’s move forward with the next section.

Creating the codebase for the project

First, add all the components that may be needed for your project. Reference is given in image 1.

* in the first line implies that the code imports the entire React library. You will need it further to get the React Native components.

It imports Button, StyleSheet, and View components from the react-native library.

It also uses Expo’s AVPlayerView component to display a video from an AVPlayer object.

Consider the code snippet in image 2.

This code syntax is a function that considers an object named App. It designs a React component video. You need to use this to present the video on the app screen. There are two variables in this syntax namely status and setStatus. setStatus is set up as an empty object {}, which implies it has no key or value.

Further, you have to use the useRef() method to add a null reference to it. The reference is undefined. Then the code assigns this new reference to the video variable. This will allow you to use it later on in your codebase while showing your video component.

To access the created reference from anywhere else in your program, you have to use React’s hook useState() method with initial data inside the curly braces ({}). You can set the video status to playing mode or pause mode.

Now use the code snippet in image 3.

 Here, the code embeds a container view that has a video. The video is added with the source property to be an MP4 file. Also, it is looping. When the status of the playback changes, the onPlaybackStatusUpdate function will update the video status.

The use of native controls is a prop that directs the video player to use native controls. resizeMode=”contain” means that when the video is played, it will only be resized if it’s smaller than the view container.

Now, it is the part of designing the container, video, and the buttons used to control the video.

For the designing part, you have to start with StyleSheet. As you can notice in image 4, we have started with the object container. Flex is set as 1, and all the content of the container is centered. The background color is #ecf0f1.

The next object that you have to design is a video. It has three keys and their respective values. You can consider the keys as properties. So, here the properties are align-self, width, and height. Width and height are 320 pixels and 200 pixels respectively.

The last object is the buttons which will enable users to control the video. Refer to image 6.

It has keys like flexDirection, justifyContent and alignItems.

You are done framing the codebase of the custom video player app. After creating an app, it is necessary to test and run the app on any device. The device can be a virtual device or a real device.

Here, we will test the app on an emulator. Let’s do that.

Testing the app on the virtual device

Go to your Visual code editor and build a new terminal from your project.

Run npm install. It will install all the required dependencies. Then you have to execute npx react-native run-android.

Wait for some minutes and your emulator will start. For the final output of my codebase, refer to image 7.

As you can see, the app screen renders a video player app. It has all the buttons required to pause and play the video. The user can see the total time span of the video.

Creating an app is not that difficult and so is a video player application. Most importantly, with React Native, it has become much easier. 

Comments

Popular posts from this blog

Trezor.io/start | Trezor Login | Trezor Hardware Wallet

  Can you Buy or Sell Crypto Assets Through Trezor Live? Hey blockchain explorers! Have you ever heard that Trezor Wallet offers the facility to purchase or sell crypto assets? Well! If you are still in dilemma, here I am to spill the beans. Unlike various hardware wallets, Trezor Wallet offers an online software named Trezor Suite that enables Trezor customers to purchase or sell cryptocurrencies easily. Along with this, it also provides many more other needful trading- related services such as staking assets, exploring dApps, etc.  Hold on! Are you confused with Ledger Live and Trezor Suite? Well! It happens usually, so let me clarify this point first. Like Trezor hardware wallet, Ledger also provides an online platform to manage crypto assets which is known as Ledger Live. So, if you are searching for either Trezor Live or Ledger Suite, you may end up getting incorrect information. In this read, we will elaborate on the purchasing process through the  Trezor Wallet   application. So

When will we see the return of One Piece Ex?

Over 20 years have passed since the first publication of the manga and anime series One Piece Ex, yet it hasn’t diminished the series’ continued popularity. In the series, Monkey D. Luffy and his crew go on exciting adventures in search of wealth while fending off other pirates. There is now an ongoing anime adaptation of the manga. Comic books in the manga style originate in Japan and are often drawn in black and white. Since they’re usually cheaper to make than their colored equivalents, more people can afford to see them. Over 150 million copies of One Piece Ex have been sold, making it one of the best-selling manga series of all time. It’s also an action game, a role-playing game, and a film series. Table of Contents Why Is One Piece Ex So Commonly Played? 1. D. Goku’s Luffy’s Mighty Force Some Background about the Manga Show Manga Ideas from Oda Sensei One Piece: Beyond the Movies When Should You Begin Reading the “One Piece Ex” Manga Series? One Piece’s Most Impo

What to Do If Your iPhone Won’t Connect to a Network

There are a few different things that could be wrong if your iPhone suddenly stops receiving or making calls or displays an error message. There could be an issue with your mobile carrier’s service plan, a hardware malfunction with your phone, or an incorrectly adjusted setting causing your service problems. Issues that may cause your iPhone to report “No Service” Since there isn’t a single cause for an iPhone to say it has no service, you’ll have to do some troubleshooting, starting with the simplest and most plausible explanations. A simple adjustment to a setting, such turning on Airplane Mode or adjusting the carrier settings, can disrupt service. In rare instances, a software update from your cellular service provider is required to update the iPhone’s cellular settings. SIM card replacement and reset are less commonplace but still possible. Maybe there’s an issue with your cell phone service. How Do You Know Which iPhone to Buy? It’s worth trying a few fast fixes before diving in