data's are i stored video path in Redis database like shown below :
r.hset("10-10-21", "12am", "videos/Fastapi/video1.mp4" ),
r.hset("10-10-21", "1am", "videos/Fastapi/video2.mp4" ),
r.hset("10-10-21", "2am", "videos/Fastapi/video3.mp4" ),
In react create a simple date picker with API, sending a request to API. After getting a response from API, data is fetched on display and convert as a URL,

My code for calling API and mapping function.
import React, { Component } from 'react'
import axios from 'axios'
// import '../App.css'
class PostForm extends Component {
constructor(props) {
super(props)
this.state = {
key: '10-10-21',
// Where data will be saved.
data: [],
}
console.log(this.state)
}
changeHandler = e => {
this.setState({ [e.target.name]: e.target.value })
}
submitHandler = e => {
e.preventDefault()
axios
.get(`http://127.0.0.1:8000/hvals_hash?key=${this.state.key}`)
.then(response => {
// Updating the state to trigger a re-render
this.setState({data: response.data});
console.log(response)
})
.catch(error => {
console.log(error)
})
}
render() {
const { key } = this.state
return (
<center><div>
<form onSubmit={this.submitHandler}>
<div>
<h2> DATE PICKER</h2><br></br>
<input
type="text"
name="key"
value={key}
onChange={this.changeHandler}
/>
</div>
<br></br>
<button type="submit">Submit</button>
</form>
<div>
<table>
<br/>
<tr>
<th>videos</th>
{/* <th>Buttons</th> */}
</tr>
{this.state.data.map((data) =>
{
return (
<div>
<tr>
{
<ul>
<a href="">{data}</a>
</ul>
}
</tr>
</div>
);
})}
</table>
</div>
</div></center>
)
}
}
export default PostForm
Now How to call Local video dynamically via URL method And pass video to react video player.
Summary :
- How to access local video through URL's
- Pass video to react video player