# \[Superpost\] Possible to keep screen active / screen on?

**URL:** <https://community.thunkable.com/t/superpost-possible-to-keep-screen-active-screen-on/63540>\
**Category:** Questions about Thunkable X\
**Tags:** solved, superpost\
**Created:** [January 7, 2019, 12:28am UTC](https://community.thunkable.com/t/superpost-possible-to-keep-screen-active-screen-on/63540 "2019-01-07T00:28:57Z")\
**Posts on this page:** 20\
**Page:** 3

<div class="post-metadata">

**Author:** ![domhnallohanlon](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/domhnallohanlon/32/29554_2.png) [@domhnallohanlon](https://community.thunkable.com/u/domhnallohanlon)\
**Post date:** [October 31, 2019, 4:58pm UTC](https://community.thunkable.com/t/superpost-possible-to-keep-screen-active-screen-on/63540/41 "2019-10-31T16:58:14Z")

</div>

Have you considered using an alert or similar to prompt your users to watch in full screen?

What sort of app are creating and how are you using video as part of it?

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [October 31, 2019, 6:55pm UTC](https://community.thunkable.com/t/superpost-possible-to-keep-screen-active-screen-on/63540/42 "2019-10-31T18:55:26Z")

</div>

> Of course if you have sleep mode at 30 mins, the screen will stay on for 30 mins, right?

Yes.

I agree with you. Many users are only able to dial a number on your phone.

I should service be better? It is a question of Philosophy. I know how to use 1% of the phones features, but if I need something that I can not be lazy and learn it. The user does not wish to think and wants to service has always been on the 100%? This can never be. The user can buy the iPhone 11, but if the user really does not think that such a phone and it will seem unfriendly.

---

<div class="post-metadata">

**Author:** ![hhuman](https://avatars.discourse-cdn.com/v4/letter/h/3be4f8/32.png) [@hhuman](https://community.thunkable.com/u/hhuman)\
**Post date:** [October 31, 2019, 7:20pm UTC](https://community.thunkable.com/t/superpost-possible-to-keep-screen-active-screen-on/63540/43 "2019-10-31T19:20:35Z")

</div>

I figured it out guys! Acetech, you gave me the solution except it wasn’t in this message thread, but another thread. It was a really simple straight forward method involving the webviewer and looping with video asset. So thank you for your generosity in sharing on here.

Domhall, I’m making an app that reads God’s words randomly. The video is to keep the screen on and the app running.

---

<div class="post-metadata">

**Author:** ![io.nut.ilie](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/io.nut.ilie/32/51367_2.png) [@io.nut.ilie](https://community.thunkable.com/u/io.nut.ilie)\
**Post date:** [January 31, 2020, 8:25pm UTC](https://community.thunkable.com/t/superpost-possible-to-keep-screen-active-screen-on/63540/44 "2020-01-31T20:25:17Z")

</div>

Hello!  
Could you please also give us the link of the post with the solution?  
Thank you!

---

<div class="post-metadata">

**Author:** ![hhuman](https://avatars.discourse-cdn.com/v4/letter/h/3be4f8/32.png) [@hhuman](https://community.thunkable.com/u/hhuman)\
**Post date:** [February 1, 2020, 12:59am UTC](https://community.thunkable.com/t/superpost-possible-to-keep-screen-active-screen-on/63540/45 "2020-02-01T00:59:16Z")

</div>

> [@Media Files (audio and video)](http://community.thunkable.com/t/media-files-audio-and-video/3747/13):
>
> I created a list with URLs and I used web view to play the video on the screen. It is not perfect but it is working fine. The veb view gets random URLs from my list.

> [@How to make video player which play video in loop](http://community.thunkable.com/t/how-to-make-video-player-which-play-video-in-loop/30905/3):
>
> I’m trying to do the same - where can I input the hmtl5 code? In blocks somewhere? In blocks under “Control” there is a “repeat 10 times” command but I can’t figure out how to make it wait until the video has played and then start it again. I’m using a short video clip inside the app.

---

<div class="post-metadata">

**Author:** ![io.nut.ilie](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/io.nut.ilie/32/51367_2.png) [@io.nut.ilie](https://community.thunkable.com/u/io.nut.ilie)\
**Post date:** [February 1, 2020, 1:11am UTC](https://community.thunkable.com/t/superpost-possible-to-keep-screen-active-screen-on/63540/46 "2020-02-01T01:11:39Z")

</div>

**Thank you!** @hhuman 🙏

---

<div class="post-metadata">

**Author:** ![hhuman](https://avatars.discourse-cdn.com/v4/letter/h/3be4f8/32.png) [@hhuman](https://community.thunkable.com/u/hhuman)\
**Post date:** [February 1, 2020, 1:31am UTC](https://community.thunkable.com/t/superpost-possible-to-keep-screen-active-screen-on/63540/47 "2020-02-01T01:31:56Z")

</div>

You’re welcome! I went with this method instead for my app… check it out: [Keep the screen active](http://community.thunkable.com/t/keep-the-screen-active/118584/8)

---

<div class="post-metadata">

**Author:** ![io.nut.ilie](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/io.nut.ilie/32/51367_2.png) [@io.nut.ilie](https://community.thunkable.com/u/io.nut.ilie)\
**Post date:** [February 1, 2020, 1:57am UTC](https://community.thunkable.com/t/superpost-possible-to-keep-screen-active-screen-on/63540/48 "2020-02-01T01:57:38Z")

</div>

**Just amazing!** 😀  
Exactly what I was looking for!  
Can you give me also a clue on how to get a trigger for this on a screen?  
Thank you!

---

<div class="post-metadata">

**Author:** ![hhuman](https://avatars.discourse-cdn.com/v4/letter/h/3be4f8/32.png) [@hhuman](https://community.thunkable.com/u/hhuman)\
**Post date:** [February 1, 2020, 4:35pm UTC](https://community.thunkable.com/t/superpost-possible-to-keep-screen-active-screen-on/63540/49 "2020-02-01T16:35:38Z")

</div>

I’ll share it in: [Keep the screen active](http://community.thunkable.com/t/keep-the-screen-active/118584/8)

---

<div class="post-metadata">

**Author:** ![io.nut.ilie](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/io.nut.ilie/32/51367_2.png) [@io.nut.ilie](https://community.thunkable.com/u/io.nut.ilie)\
**Post date:** [February 1, 2020, 4:59pm UTC](https://community.thunkable.com/t/superpost-possible-to-keep-screen-active-screen-on/63540/50 "2020-02-01T16:59:52Z")

</div>

**Thank you very much!**

---

<div class="post-metadata">

**Author:** ![io.nut.ilie](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/io.nut.ilie/32/51367_2.png) [@io.nut.ilie](https://community.thunkable.com/u/io.nut.ilie)\
**Post date:** [February 2, 2020, 8:05pm UTC](https://community.thunkable.com/t/superpost-possible-to-keep-screen-active-screen-on/63540/51 "2020-02-02T20:05:24Z")

</div>

Hello.

I know that this topic was discussed [in this post](http://community.thunkable.com/t/solved-video-player-does-not-keep-the-screen-on-while-playing/295641/20) and in [this post](http://community.thunkable.com/t/keep-the-screen-active/118584/8) and they are marked as Solved, but for me it is not clear yet.

I know that @hhuman [posted the solution](http://community.thunkable.com/t/keep-the-screen-active/118584/8) but I was trying to workaround and **to have the webpage / screen in the app activ as the user open the screen without any interaction.**

So, the idea is to have the screen active as it opens.  
I have removed the button for user interaction and I have the app screen full alive, **without any enabling button, BUT** it is not working if the user has the phone on Low Battery Mode…  
**AS I use** the version from @hhuman with the button that it is enabled by user, the screen stays alive even if the phone it is on Low Battery Mode.  
WHY?

1. Does anybody has idea how to make it to work even on Low Battery?
2. Can somebody provide me a solution to have the enabling button under a Thunkable button?

Here is the code from my version, without button with onload function:

```
<html>
  <head>
    <title>NoSleep.js - Simple Test Page</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
<script src="NoSleep.min.js"></script>
<script>
      function myFunction() {
  var noSleep = new NoSleep();
       noSleep.enable(); // keep the screen on!
       document.body.style.backgroundColor = "green";
    }
    </script>
  </head>
  <body onload="myFunction()">
    <h1>NoSleep Test Page</h1>
  </body>
</html>

```

And this is the code from the original version:

```
<html>
      <head>
        <title>NoSleep.js - Simple Test Page</title>
        <meta name="viewport" content="width=device-width, initial-scale=1">
      </head>
      <body>
        <h1>NoSleep Test Page</h1>
        <script src="NoSleep.min.js"></script>
        <input type="button" id="toggle" value="Wake Lock is disabled" />
        <script>
          var noSleep = new NoSleep();
          var wakeLockEnabled = false;
          var toggleEl = document.querySelector("#toggle");
          toggleEl.addEventListener('click', function() {
            if (!wakeLockEnabled) {
              noSleep.enable(); // keep the screen on!
              wakeLockEnabled = true;
              toggleEl.value = "Wake Lock is enabled";
              document.body.style.backgroundColor = "green";
            } else {
              noSleep.disable(); // let the screen turn off.
              wakeLockEnabled = false;
              toggleEl.value = "Wake Lock is disabled";
              document.body.style.backgroundColor = "";
            }
          }, false);
        </script>
      </body>
    </html>

```

Any idea?  
**Thank you!**

---

<div class="post-metadata">

**Author:** ![Chris](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/chris/32/78883_2.png) [@Chris](https://community.thunkable.com/u/Chris)\
**Post date:** [February 4, 2020, 12:39am UTC](https://community.thunkable.com/t/superpost-possible-to-keep-screen-active-screen-on/63540/52 "2020-02-04T00:39:48Z")

</div>

Hi @io.nut.ilie

Please don’t just mention a bunch of people in the community to get a faster reply.

My quick guess would be that maybe the OS does prevent JavaScript from being run without user interaction (onload) when the battery saving mode is on. Javascripts often consume quite a lot of energy so it would make sense to disable ones that just load in the background when the battery is low 🤔

Best, Chris

---

<div class="post-metadata">

**Author:** ![io.nut.ilie](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/io.nut.ilie/32/51367_2.png) [@io.nut.ilie](https://community.thunkable.com/u/io.nut.ilie)\
**Post date:** [February 4, 2020, 12:53am UTC](https://community.thunkable.com/t/superpost-possible-to-keep-screen-active-screen-on/63540/53 "2020-02-04T00:53:32Z")

</div>

**Thank you.**

---

<div class="post-metadata">

**Author:** ![kartik14](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/kartik14/32/44782_2.png) [@kartik14](https://community.thunkable.com/u/kartik14)\
**Post date:** [February 4, 2020, 10:59am UTC](https://community.thunkable.com/t/superpost-possible-to-keep-screen-active-screen-on/63540/54 "2020-02-04T10:59:12Z")

</div>

Hi, @io.nut.ilie! 👋

Should we consider your problem as solved?

Thanks a lot!

**P.S.** Anytime you would like to mention me, please mention @kartik14 instead of `@kartik` (`@kartik` is discontinued account, so I might not get any message.)

---

<div class="post-metadata">

**Author:** ![io.nut.ilie](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/io.nut.ilie/32/51367_2.png) [@io.nut.ilie](https://community.thunkable.com/u/io.nut.ilie)\
**Post date:** [February 4, 2020, 11:17am UTC](https://community.thunkable.com/t/superpost-possible-to-keep-screen-active-screen-on/63540/55 "2020-02-04T11:17:42Z")

</div>

Thank you @kartik14 for your replay!  
I understand what may be the cause but this is not the solution.  
I need to have in a way the trigger it with a Thunkable button, that will generate more actions, beside the enabling of the NoSleep.  
🙏

---

<div class="post-metadata">

**Author:** ![hhuman](https://avatars.discourse-cdn.com/v4/letter/h/3be4f8/32.png) [@hhuman](https://community.thunkable.com/u/hhuman)\
**Post date:** [February 10, 2020, 6:29pm UTC](https://community.thunkable.com/t/superpost-possible-to-keep-screen-active-screen-on/63540/56 "2020-02-10T18:29:55Z")

</div>

Hey, does it make any difference if you have the html file loaded from online or native? How about if you have the webviewer call the file/address in the code upon screen loading?

---

<div class="post-metadata">

**Author:** ![io.nut.ilie](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/io.nut.ilie/32/51367_2.png) [@io.nut.ilie](https://community.thunkable.com/u/io.nut.ilie)\
**Post date:** [February 11, 2020, 10:10am UTC](https://community.thunkable.com/t/superpost-possible-to-keep-screen-active-screen-on/63540/57 "2020-02-11T10:10:03Z")

</div>

Thank you @hhuman.  
I am not sure how to implement it native and for the moment I just abandoned it the project.  
Anyway, the idea of keeping alive the screen it is essential for many types of apps.

---

<div class="post-metadata">

**Author:** ![hhuman](https://avatars.discourse-cdn.com/v4/letter/h/3be4f8/32.png) [@hhuman](https://community.thunkable.com/u/hhuman)\
**Post date:** [February 14, 2020, 4:08am UTC](https://community.thunkable.com/t/superpost-possible-to-keep-screen-active-screen-on/63540/58 "2020-02-14T04:08:15Z")

</div>

I’m sorry that you put the project aside for now. To implement it in the app, I had to add the js script to the header of the html file itself and just uploaded as an asset and set webviewer block to wakelock.html in the code block upon screen loading up.

I combined your auto wake lock function and the original toggle button together in the body of the html file and it locks upon startup for my devices. So in case it doesn’t auto lock, the button is right there for the user to enable themself. The only thing is that for some devices, it doesn’t disable when they click disable… not a big problem.

So thank you for sharing your work above that my app is now improved.

\*This is all for android that I am talking about btw. Not sure about iOS.

---

<div class="post-metadata">

**Author:** ![kizzy](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/kizzy/32/76421_2.png) [@kizzy](https://community.thunkable.com/u/kizzy)\
**Post date:** [February 14, 2020, 4:19am UTC](https://community.thunkable.com/t/superpost-possible-to-keep-screen-active-screen-on/63540/59 "2020-02-14T04:19:12Z")

</div>

really wish there was a way for this i have a podcast app and have to have the player load externally But i had another streaming radio app which played in the background but dont seem to have that option here on thunkable

---

<div class="post-metadata">

**Author:** ![rojroj101s](https://avatars.discourse-cdn.com/v4/letter/r/ec9cab/32.png) [@rojroj101s](https://community.thunkable.com/u/rojroj101s)\
**Post date:** [March 14, 2020, 5:14am UTC](https://community.thunkable.com/t/superpost-possible-to-keep-screen-active-screen-on/63540/60 "2020-03-14T05:14:32Z")

</div>

Hey Thunkers,

I found 2 threads on talking about keep the screen active while the app is open. As mentioned in those threads, the screen times out according to the phones setting. Which is usually 30 second, I like other thunks would like my screen to remain on longer then the 30 seconds while the user is using the app. I read the setting in the phone cannot be changes with thunkable x. I tried to run a timer and change the text… My phone still went black in 30 seconds. Then I saw some threads about “Keep the screen active by looping webview with a video asset…” I’m not exactly sure if someone can explain or help me do this, because it seems likes its the solution to my problem… Unless anyone has any other thoughts.

Thanks,  
Rob

[Previous page](https://community.thunkable.com/t/superpost-possible-to-keep-screen-active-screen-on/63540.md?page=2)

[Next page](https://community.thunkable.com/t/superpost-possible-to-keep-screen-active-screen-on/63540.md?page=4)
