# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import requests

import streamlit as st

url = "https://www.w3schools.com/html/mov_bbb.mp4"
file = requests.get(url).content
st.video(file)

e2e/scripts/st_video.py
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import requests

import streamlit as st

url = "https://www.w3schools.com/html/mov_bbb.mp4"
file = requests.get(url).content
st.video(file)

# Test start time with widget
timestamp = st.number_input("Start Time (in seconds)", min_value=0, value=6)
st.video(url, start_time=int(timestamp))

e2e/scripts/st_video.py
diff --git a/e2e/scripts/st_video.py b/e2e/scripts/st_video.py
index 376155d892b9..0d93fe4ff58c 100644
--- a/e2e/scripts/st_video.py
+++ b/e2e/scripts/st_video.py
@@ -19,3 +19,7 @@
 url = "https://www.w3schools.com/html/mov_bbb.mp4"
 file = requests.get(url).content
 st.video(file)
+
+# Test start time with widget
+timestamp = st.number_input("Start Time (in seconds)", min_value=0, value=6)
+st.video(url, start_time=int(timestamp))
diff --git a/e2e/specs/st_video.spec.js b/e2e/specs/st_video.spec.js
index 003cb7b44cc7..7c1545609b93 100644
--- a/e2e/specs/st_video.spec.js
+++ b/e2e/specs/st_video.spec.js
@@ -22,6 +22,21 @@ describe("st.video", () => {
   });
 
   it("displays a video player", () => {
-    cy.get(".element-container .stVideo").should("have.attr", "src");
+    cy.getIndexed(".element-container .stVideo", 0).should("have.attr", "src");
+  });
+
+  it("handles a start time", () => {
+    cy.getIndexed(".element-container .stVideo", 1).should("have.attr", "src");
+  });
+
+  it("handles changes in start time", () => {
+    // Change the start time from 6 to 5
+    cy.get(".element-container .stNumberInput .step-down").click();
+
+    // Wait for the video start time to update
+    cy.wait(3000);
+
+    // Confirm video updated
+    cy.getIndexed(".element-container .stVideo", 1).matchImageSnapshot("video-updated-start");
   });
 });
diff --git a/frontend/cypress/snapshots/linux/2x/st_video.spec.js/video-updated-start.snap.png b/frontend/cypress/snapshots/linux/2x/st_video.spec.js/video-updated-start.snap.png
new file mode 100644
index 000000000000..5b863b082689
Binary files /dev/null and b/frontend/cypress/snapshots/linux/2x/st_video.spec.js/video-updated-start.snap.png differ
diff --git a/frontend/lib/src/components/elements/Video/Video.tsx b/frontend/lib/src/components/elements/Video/Video.tsx
index 67d9ebe74be6..b028922d1096 100644
--- a/frontend/lib/src/components/elements/Video/Video.tsx
+++ b/frontend/lib/src/components/elements/Video/Video.tsx
@@ -35,7 +35,14 @@ export default function Video({
 
   /* Element may contain "url" or "data" property. */
 
-  const { type, url } = element
+  const { type, url, startTime } = element
+
+  // Handle startTime changes
+  useEffect(() => {
+    if (videoRef.current) {
+      videoRef.current.currentTime = startTime
+    }
+  }, [startTime])
 
   useEffect(() => {
     const videoNode = videoRef.current

Changing start_time of st.video() doesn't work for the same video
### Checklist

- [X] I have searched the [existing issues](https://github.com/streamlit/streamlit/issues) for similar issues.
- [X] I added a very descriptive title to this issue.
- [X] I have provided sufficient information below to help reproduce this issue.

### Summary

Changing start_time of st.video() doesn't work for the same video.

### Reproducible Code Example

```Python
import streamlit as st

timestamp = st.text_input('timestamp', '6')
st.video('local video path', start_time=int(timestamp))
```


### Steps To Reproduce

1. Replace 'local video path' with your own video path in the provided code, and run the code
2. Type different timestamp in the text input box
3. The video timestamp doesn't change

### Expected Behavior

The timestamp should change as start_time changes.

### Current Behavior

The video timestamp doesn't change. It always shows the initial timestamp. However, if you change the video to a different one in the source code and rerun the app, the timestamp will change correctly.

### Is this a regression?

- [ ] Yes, this used to work in a previous version.

### Debug info

- Streamlit version: 1.25.0
- Python version: Python 3.10.11
- Operating System: Windows 11 Home 22H2
- Browser: Microsoft Edge Version 115.0.1901.188 (Official build) (64-bit)


### Additional Information

_No response_
