# Stream not found. Apple HLS

**URL:** <https://community.wowza.com/t/stream-not-found-apple-hls/46696>\
**Category:** Wowza Streaming Engine\
**Created:** [April 17, 2016, 8:38pm UTC](https://community.wowza.com/t/stream-not-found-apple-hls/46696 "2016-04-17T20:38:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tadas\_Zidonis](https://avatars.discourse-cdn.com/v4/letter/t/8baadc/32.png) [@Tadas\_Zidonis](https://community.wowza.com/u/Tadas_Zidonis)\
**Post date:** [April 17, 2016, 8:38pm UTC](https://community.wowza.com/t/stream-not-found-apple-hls/46696/1 "2016-04-17T20:38:50Z")

</div>

Hello,

Some time ago i have implemented [Switching between live streams](http://community.wowza.com/t/-/46695)

Using lower-level API.

Basically live stream is created. Another incoming live stream and static video is switched (sort of overlay).

Everything was working until recently i saw logs full of following errors:

HTTPStreamerAdapterCupertinoStreamer.onPlaylist: Stream not found [live/smil:lrytas.smil/chunklist\_w866886594\_b864000\_slLT\_t64SEk=.m3u8]: lr\_hi\_NLT

Investigation led to this conclusion:

When live incomming stream reconnection happens and my switcher in playing live stream (is static video is shown nothing happens) apple HLS player (JWPlayer or [http://dailymotion.github.io/hls.js/demo/](http://dailymotion.github.io/hls.js/demo/)) stops playing.

Page reload returns 404. Server restart solves issue until next reconnect.

I suspect temporal live stream publish of ‘empty’ stream does this.

Wowza test players RTMP, HDS are working then.

Question what to do? Is this apple HLS issue, wowza, or my code?

this is actual switch method:

```auto
private void switchStreams(StreamData streamData, boolean showLive, boolean fileHasEnded) {
		if (streamData.provider != null)
			streamData.provider.close();
		streamData.provider = null;
		
		Publisher publisher = streamData.publisher;
		if (showLive) {
			String liveStream = streamData.config.liveStream;
			streamData.provider = new PublishingProviderLive(publisher, publisher.getMaxTimecode(), liveStream);
			streamData.provider.setRealTimeStartTime(System.currentTimeMillis());
			logUtil.info("Stream: " + streamData.name + " switching to live stream: " + liveStream);
		} else {
			String overlay = streamData.config.overlayFile;
			streamData.provider = new PublishingProviderMediaReader(publisher, publisher.getMaxTimecode(), overlay);
			streamData.provider.setRealTimeStartTime(System.currentTimeMillis());
			if (!fileHasEnded) {
				logUtil.info("Stream: " + streamData.name + " switching to overlay: " + overlay);				
			} else {
				logUtil.debug("Stream: " + streamData.name + " restarting overlay file");
			}
			
		}
	}

```

Stream data class:

```auto
private class StreamData {
		String name;
		boolean showLive;
		TranscoderDestinationConfig config;
		
		IPublishingProvider provider;
		Publisher publisher;
		
		public StreamData(String name, boolean showLive, IPublishingProvider provider, Publisher publisher,
				TranscoderDestinationConfig config) {
			
			this.name = name;
			this.showLive = showLive;
			this.config = config;
			this.provider = provider;
			this.publisher = publisher;
		}
		
		boolean play() {
			try {
				return provider.play(publisher);
			} catch (Exception e) {
				logUtil.error("Live playback exception happened: " + e.getMessage());
				return false;
			}
		}
	}

```

StreamData#play() is called elsewere

BTW.

```auto
provider.play(publisher)

```

Always return false playing a PublishingProviderLive. Why?

---

<div class="post-metadata">

**Author:** ![Roger\_Littin1](https://avatars.discourse-cdn.com/v4/letter/r/c89c15/32.png) [@Roger\_Littin1](https://community.wowza.com/u/Roger_Littin1)\
**Post date:** [May 9, 2016, 3:21pm UTC](https://community.wowza.com/t/stream-not-found-apple-hls/46696/2 "2016-05-09T15:21:10Z")

</div>

Hi,

The most likely reason it isn’t working is because **provider.play(publisher);** is returning false for some reason. This method is supposed to be called in a loop and it will process any new packets that have arrived on the stream. When false is returned, you should switch to another publishing provider so that the stream resumes. If you continue calling the same provider, it will continue to return false and the output stream will stall. Looking at your code, assuming you’re calling provider.play(publisher); at regular intervals, the most likely reason that it’s not working is because the live stream name that you are passing to PublishingProviderLive doesn’t exist.

Roger.
