# how to get live stream with aplication name and stream name?

**URL:** https://community.wowza.com/t/how-to-get-live-stream-with-aplication-name-and-stream-name/44096
**Category:** Wowza Developer Dojo
**Tags:** wowza-streaming-server-java-api
**Created:** [November 20, 2014, 2:57am UTC](https://community.wowza.com/t/how-to-get-live-stream-with-aplication-name-and-stream-name/44096 "2014-11-20T02:57:14Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![qizhao\_lee](https://avatars.discourse-cdn.com/v4/letter/q/b3f665/32.png) [@qizhao\_lee](https://community.wowza.com/u/qizhao_lee)
#### Post date: [November 20, 2014, 2:57am UTC](https://community.wowza.com/t/how-to-get-live-stream-with-aplication-name-and-stream-name/44096/1 "2014-11-20T02:57:14Z")

</div>

public void onHTTPRequest(IVHost vhost, IHTTPRequest req, IHTTPResponse resp) {

String app = “live”;

String streamName = “test1.stream”;[//test.stream](https://test.stream) is active

if (params.containsKey(“app”))

app = params.get(“app”).get(0);

if (params.containsKey(“stream”))

streamName = params.get(“stream”).get(0);

IApplicationInstance appInstance = vhost.getApplication(app).getAppInstance(“_definst_”);

Stream stream = (Stream)appInstance.getProperties().getProperty(streamName);

java.util.List itemList=stream.getPlaylist();

///////

i want to get playlist, but stream is null forever.how to get live stream ?

please help me. thanks.

---

<div class="post-metadata">

### Author: ![qizhao\_lee](https://avatars.discourse-cdn.com/v4/letter/q/b3f665/32.png) [@qizhao\_lee](https://community.wowza.com/u/qizhao_lee)
#### Post date: [November 20, 2014, 5:03pm UTC](https://community.wowza.com/t/how-to-get-live-stream-with-aplication-name-and-stream-name/44096/2 "2014-11-20T17:03:30Z")

</div>

help me

---

<div class="post-metadata">

### Author: ![qizhao\_lee](https://avatars.discourse-cdn.com/v4/letter/q/b3f665/32.png) [@qizhao\_lee](https://community.wowza.com/u/qizhao_lee)
#### Post date: [November 20, 2014, 7:14pm UTC](https://community.wowza.com/t/how-to-get-live-stream-with-aplication-name-and-stream-name/44096/3 "2014-11-20T19:14:25Z")

</div>

INFO stream create - -

WARN server comment - Publisher.publish: Stream name already in use: test1.stream

INFO stream publish test1.stream -

---

<div class="post-metadata">

### Author: ![1111](https://avatars.discourse-cdn.com/v4/letter/1/71e660/32.png) [@1111](https://community.wowza.com/u/1111)
#### Post date: [December 17, 2014, 12:34pm UTC](https://community.wowza.com/t/how-to-get-live-stream-with-aplication-name-and-stream-name/44096/4 "2014-12-17T12:34:33Z")

</div>

The Stream class is used for server-side streams. It implements the IMediaStream interface but a IMediaStream is not necessarily a Stream.

You can do this:

```auto
IMediaStream stream = appInstance.getStreams().getStream(streamName);

```

If you want to use the Stream class you will need to do your own server side-publishing. You can then point your Stream to a live stream using Stream.play(liveStreamName, -2, -1, true)

Check out this article:

[https://www.wowza.com/docs/how-to-do-basic-server-side-publishing-with-stream-class-streams](https://www.wowza.com/docs/how-to-do-basic-server-side-publishing-with-stream-class-streams)
