# HLS hangs when switching from server side stream to live stream

**URL:** <https://community.wowza.com/t/hls-hangs-when-switching-from-server-side-stream-to-live-stream/55484>\
**Category:** Wowza Streaming Engine\
**Created:** [June 28, 2020, 7:56pm UTC](https://community.wowza.com/t/hls-hangs-when-switching-from-server-side-stream-to-live-stream/55484 "2020-06-28T19:56:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel\_Rossi](https://avatars.discourse-cdn.com/v4/letter/d/e95f7d/32.png) [@Daniel\_Rossi](https://community.wowza.com/u/Daniel_Rossi)\
**Post date:** [June 28, 2020, 7:56pm UTC](https://community.wowza.com/t/hls-hangs-when-switching-from-server-side-stream-to-live-stream/55484/1 "2020-06-28T19:56:44Z")

</div>

I am repurposing the loop until live code to setup the server stream on request, and when publishing switch to the live stream. I am able to subscribe with HLS immediate after the stream is setup. But when publishing , the HLS stream playback fails but fragments are downloading.

So in this part, is not switching for HLS, a refresh is required

List playlist = stream.getPlaylist();

PlaylistItem currentItem = stream.getCurrentItem();

int currentItemIndex = currentItem != null ? currentItem.getIndex() : 0;

playlists.put(outName, playlist);

playlistIndexes.put(outName, currentItemIndex);

stream.play(streamName, -2, -1, true);

---

<div class="post-metadata">

**Author:** ![Rose\_Power-Wowza\_Com](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/rose_power-wowza_com/32/431_2.png) [@Rose\_Power-Wowza\_Com](https://community.wowza.com/u/Rose_Power-Wowza_Com)\
**Post date:** [June 29, 2020, 5:25pm UTC](https://community.wowza.com/t/hls-hangs-when-switching-from-server-side-stream-to-live-stream/55484/2 "2020-06-29T17:25:50Z")

</div>

Please send a support ticket so tech support can debug your issue. They do not debug in the forums since it requires full access to your code and logs. Thanks.

[https://www.wowza.com/support/open-ticket](https://www.wowza.com/support/open-ticket)
