# Using Media node for node red dashboard - Video Autoplay "Run on Start" not working

**URL:** <https://discourse.nodered.org/t/using-media-node-for-node-red-dashboard-video-autoplay-run-on-start-not-working/78936>\
**Category:** General\
**Tags:** node-red-dashboard\
**Created:** [4 June 2023 09:08 UTC](https://discourse.nodered.org/t/using-media-node-for-node-red-dashboard-video-autoplay-run-on-start-not-working/78936 "2023-06-04T09:08:40Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![saraltech](https://avatars.discourse-cdn.com/v4/letter/s/71e660/32.png) [@saraltech](https://discourse.nodered.org/u/saraltech)\
**Post date:** [4 June 2023 09:08 UTC](https://discourse.nodered.org/t/using-media-node-for-node-red-dashboard-video-autoplay-run-on-start-not-working/78936/1 "2023-06-04T09:08:40Z")

</div>

Dear All,

I am using Media node for running a video on Node red dashboard.  
Everything works well except that video does not start automatically. I have enabled "run on start" option. Still everytime, I have to press play button to make it play.

Node Red version: v2.2.2  
Media node version: 1.2.0

my flow is as below:

```auto
[
    {
        "id": "66a893890f0d1afc",
        "type": "ui_media",
        "z": "2a49a3ed09ee2b01",
        "group": "2ead0f3054aaadd1",
        "name": "",
        "width": 24,
        "height": 16,
        "order": 1,
        "category": "videos",
        "file": "Saral Technologies_Presentation - 02102022.mp4",
        "layout": "adjust",
        "showcontrols": true,
        "loop": true,
        "onstart": true,
        "scope": "local",
        "tooltip": "",
        "x": 410,
        "y": 280,
        "wires": [
            []
        ]
    },
    {
        "id": "2ead0f3054aaadd1",
        "type": "ui_group",
        "name": "Screen1",
        "tab": "2a3bf24941459982",
        "order": 1,
        "disp": false,
        "width": 30,
        "collapse": false,
        "className": ""
    },
    {
        "id": "2a3bf24941459982",
        "type": "ui_tab",
        "name": "CTQ_Screen",
        "icon": "dashboard",
        "order": 1,
        "disabled": false,
        "hidden": false
    }
]

```

Screen shot for Media node configuration:

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/b/fbe45d8bf50d87314e68a4e8bc888c41720f0653.png)

Please help with suggestion to make it Auto Play everytime any user open the dashboard.

thanks.

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [4 June 2023 09:30 UTC](https://discourse.nodered.org/t/using-media-node-for-node-red-dashboard-video-autoplay-run-on-start-not-working/78936/2 "2023-06-04T09:30:15Z")

</div>

I know on my browsers i have disabled auto start video, maybe your browser is set to not auto start to.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [4 June 2023 10:00 UTC](https://discourse.nodered.org/t/using-media-node-for-node-red-dashboard-video-autoplay-run-on-start-not-working/78936/3 "2023-06-04T10:00:16Z")

</div>

Most if not all browsers refuse autoplay unless the user has interacted with the page in some way. This is to prevent annoying autoplay video adverts from automatically running. If I remember correctly, this is mentioned in the MDN documentation.

---

<div class="post-metadata">

**Author:** ![saraltech](https://avatars.discourse-cdn.com/v4/letter/s/71e660/32.png) [@saraltech](https://discourse.nodered.org/u/saraltech)\
**Post date:** [4 June 2023 10:19 UTC](https://discourse.nodered.org/t/using-media-node-for-node-red-dashboard-video-autoplay-run-on-start-not-working/78936/4 "2023-06-04T10:19:30Z")

</div>

Thanks E1cid. I am using Chrome and I have checked all the settings suggested by Google Chrome. Still Its not working.

---

<div class="post-metadata">

**Author:** ![saraltech](https://avatars.discourse-cdn.com/v4/letter/s/71e660/32.png) [@saraltech](https://discourse.nodered.org/u/saraltech)\
**Post date:** [4 June 2023 16:43 UTC](https://discourse.nodered.org/t/using-media-node-for-node-red-dashboard-video-autoplay-run-on-start-not-working/78936/5 "2023-06-04T16:43:10Z")

</div>

Thanks. I try to find a way out to enable it for Chrome, but could not find one. can you please help with few pointers to enable AutoPlay?

---

<div class="post-metadata">

**Author:** ![kevinGodell](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kevingodell/32/27040_2.png) [@kevinGodell](https://discourse.nodered.org/u/kevinGodell)\
**Post date:** [4 June 2023 17:06 UTC](https://discourse.nodered.org/t/using-media-node-for-node-red-dashboard-video-autoplay-run-on-start-not-working/78936/6 "2023-06-04T17:06:53Z")

</div>

If the video contains audio, then autostart will usually not work unless the video player is set muted.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [5 June 2023 00:24 UTC](https://discourse.nodered.org/t/using-media-node-for-node-red-dashboard-video-autoplay-run-on-start-not-working/78936/7 "2023-06-05T00:24:03Z")

</div>

> [@saraltech](#):
>
> I try to find a way out to enable it for Chrome, but could not find one. can you please help with few pointers to enable AutoPlay?

This is not user controllable, as I said, the details are on MDN.

[Autoplay guide for media and Web Audio APIs - Web media technologies | MDN (mozilla.org)](https://developer.mozilla.org/en-US/docs/Web/Media/Autoplay_guide)

---

<div class="post-metadata">

**Author:** ![saraltech](https://avatars.discourse-cdn.com/v4/letter/s/71e660/32.png) [@saraltech](https://discourse.nodered.org/u/saraltech)\
**Post date:** [5 June 2023 12:42 UTC](https://discourse.nodered.org/t/using-media-node-for-node-red-dashboard-video-autoplay-run-on-start-not-working/78936/8 "2023-06-05T12:42:48Z")

</div>

I have tried both with audio and without audio. Both does not play automatically.

---

<div class="post-metadata">

**Author:** ![saraltech](https://avatars.discourse-cdn.com/v4/letter/s/71e660/32.png) [@saraltech](https://discourse.nodered.org/u/saraltech)\
**Post date:** [8 June 2023 16:31 UTC](https://discourse.nodered.org/t/using-media-node-for-node-red-dashboard-video-autoplay-run-on-start-not-working/78936/9 "2023-06-08T16:31:32Z")

</div>

I used the uibuilder rather than dashboard media node. with following code in html, i could achieve the autoplay of desired video.  
Thank you very much for your efforts to make uibuilder and continuously updating it.

```auto
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <video width=80% height=auto autoplay muted>
    <source src="my_video.mp4" type="video/mp4">
    </video>
</body>
</html>

```

I need to keep the video in same src folder though.  
If I mention the following absolute path, it works well with normal HTML page. but not with uibuilder. Is there any other specific way to define absolute path in uibuilder?

absolute path : "//C:/folder1/my\_video.mp4"

Please guide.`Preformatted text`

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [8 June 2023 20:24 UTC](https://discourse.nodered.org/t/using-media-node-for-node-red-dashboard-video-autoplay-run-on-start-not-working/78936/10 "2023-06-08T20:24:34Z")

</div>

> [@saraltech](#):
>
> "//C:/folder1/my\_video.mp4"

You cannot do that even if Node-RED and the browser run on the same device. Partly because it would be a security issue to mix domains and partly because anything coming from a local folder is not being served by a web server.

I think I already mentioned that you can use filing system links to make it seem like something is in one place but is really in another. So you can create a link that tells Windows that something like `~/.node-red/uibuilder/myweb/my_video.mp4` actually exists for real at `C:/folder1/my_video.mp4`. That way uibuilder can still serve it up for you.

> [@saraltech](#):
>
> it works well with normal HTML page. but not with uibuilder

Well it might work ok if you load the html file into the browser without using a web server. But it shouldn't if you use a web server - that isn't a uibuilder thing, it is a browser security feature.

It also wouldn't help you if Node-RED were running on a different device which is the "normal" scenario for live services. In that case, your browser only has 1 way of talking to the server's filing system and that is via the http(s) protocol which requires a web server - Node-RED via ExpressJS in this case.

Another way to think about it is that your browsers local filing system is in a totally different _context_ to the filing system of the server. Node-RED is a server, your browser is a client and they are designed to work on different devices from each other.

Maybe this picture will help:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/a/1a63db06a542e7c90ded0c9df6225d94597e9d97.png)

Anyway, look up filing system links and junctions.

---

<div class="post-metadata">

**Author:** ![saraltech](https://avatars.discourse-cdn.com/v4/letter/s/71e660/32.png) [@saraltech](https://discourse.nodered.org/u/saraltech)\
**Post date:** [13 June 2023 16:03 UTC](https://discourse.nodered.org/t/using-media-node-for-node-red-dashboard-video-autoplay-run-on-start-not-working/78936/11 "2023-06-13T16:03:50Z")

</div>

Thanks for a detailed explanation. I will try the same.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [12 August 2023 16:04 UTC](https://discourse.nodered.org/t/using-media-node-for-node-red-dashboard-video-autoplay-run-on-start-not-working/78936/12 "2023-08-12T16:04:47Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
