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:
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
That was a great response I came here to find out as well...Thanks
This worked for me this week:
@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
Currently when i set control = "pause" it has change the state to pause but after 1 2 sec it has change to playing automatic