# Migrating ui template from Dashboard-1 to Dashboard-2

**URL:** <https://discourse.nodered.org/t/migrating-ui-template-from-dashboard-1-to-dashboard-2/92891>\
**Category:** Dashboard\
**Tags:** dashboard-2\
**Created:** [4 November 2024 06:58 UTC](https://discourse.nodered.org/t/migrating-ui-template-from-dashboard-1-to-dashboard-2/92891 "2024-11-04T06:58:19Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![krambriw](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/krambriw/32/5429_2.png) [@krambriw](https://discourse.nodered.org/u/krambriw)\
**Post date:** [4 November 2024 16:31 UTC](https://discourse.nodered.org/t/migrating-ui-template-from-dashboard-1-to-dashboard-2/92891/7 "2024-11-04T16:31:25Z")

</div>

Been experimenting and it works fine when playing mp4 as well as http but when I try to play a hls stream it does not start playing

Below is the specific code where I inserted a number of debug messages. It reaches the following:  
_show hls_  
_hls is supported_  
_z is set_  
_binding worked_

but it never reaches _url loaded_

Here I'm stucked, any hints would be great

The url is "/mp4frag/7424e65996a40660/hls.m3u8" and plays fine in the db-1 version both in Chrome and Safari

```auto
            if (msg.payload?.indexOf('cam') > -1 && msg.url?.indexOf('.m3u8') < 0 && msg.url?.indexOf('youtube') < 0) {
                if (this.hls_m) { this.hls_m.destroy() }
                this.show('str_')
            } else if (msg.url?.indexOf('.m3u8') > -1) {
                if (this.hls_m) { this.hls_m.destroy() }
                if (this.isSafari()) {
                    this.show('saf_')
                } else {
                    this.send({ payload: 'show hls' })
                    this.show('hls_')
                    this.hls_m = new window.Hls()
                    if (window.Hls?.isSupported()) {
                        this.send('hls is supported')
                        const z = this.$refs.hls_
                        this.send('z is set')
                        // bind them together
                        this.hls_m.attachMedia(z)
                        this.send('binding worked')
                        this.hls_m.on(window.Hls.Events.MEDIA_ATTACHED, function () {
                            this.hls_m.loadSource(msg.url)
                            this.send('url loaded')
                            this.hls_m.on(window.Hls.Events.MANIFEST_PARSED, function () {
                                this.send('hls now playing')
                                z.play()
                            })
                        })
                    }
                }

```

---

_[View the full topic](https://discourse.nodered.org/t/migrating-ui-template-from-dashboard-1-to-dashboard-2/92891)._
