- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Roku video player pause button not working
Hey Roku Community,
I'm currently working on an application that involves controlling the Roku video player, and I'm encountering an issue with pausing the video. Here's a breakdown of the problem:
Issue Description: When the user presses the pause button, I'm attempting to set m.video.state to "paused" as per the Roku video player API. However, despite setting the state to "paused", the video does not pause as expected.
Steps Taken:
- Reviewed Roku's official documentation for the video player API to ensure correct usage.
- Verified code logic to ensure that m.video.state is being set correctly when the pause button is pressed.
- Implemented console logs to track the value of m.video.state before and after attempting to pause the video.
- Tested the application in real Roku device environments to replicate the issue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Roku video player pause button not working
state is READ-ONLY and gives you the current state of the video node. control is what you want to use and you want to set it to pause.
https://developer.roku.com/docs/references/scenegraph/media-playback-nodes/video.md
Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.
I am not a Roku employee.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Roku video player pause button not working
That was a great response I came here to find out as well...Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Roku video player pause button not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Roku video player pause button not working
This worked for me this week:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Roku video player pause button not working
@Aashish_Kumar, first, stop setting the state to anything! You can't set a READ-ONLY field. Second, when it's playing, you're setting it to pause and when it's paused you're setting it to resume. It's just going to bounce back and forth between playing and paused. Without seeing the rest of the code, it's hard to say if that's part of your problem.
Add prints to your code. It's the best way to see what's going on. stop can also be utilized when things aren't happening as expected:
if m.video.state = "playing"
print "playing"
m.video.control = "pause"
stop
... other code
else if m.video.state = "paused"
print "paused"
... other code
end if
Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.
I am not a Roku employee.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Roku video player pause button not working
Currently when i set control = "pause" it has change the state to pause but after 1 2 sec it has change to playing automatic
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content