Skip to content

Commit

Permalink
Merge pull request #179 from ant-media/md/include-id3
Browse files Browse the repository at this point in the history
include id3 tags and make correction in url mapping
  • Loading branch information
yashtandon113 authored Dec 12, 2023
2 parents c0ee6e0 + 10e1cbf commit e360eb8
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,6 @@ webRTCAdaptor.publish(streamId, token, subscriberId, subscriberCode, streamName)
Above example taken from the [StreamApp repository](https://github.com/ant-media/StreamApp/blob/fb37558823769f3145be7a777343502ffd6793e4/src/main/webapp/samples/publish_webrtc.html#L509).

### Tutorial for Creating Publish and Play Page using JS SDK
- [play page creation using JS SDK](/guides/advanced-usage/webrtc-play-page-creation-tutorial/)
- [publish page creation using JS SDK](/guides/advanced-usage/webrtc-publish-page-creation-tutorial/)
- [play page creation using JS SDK](https://antmedia.io/docs/guides/developing-antmedia-server/webrtc-play-page-creation-tutorial/)
- [publish page creation using JS SDK](https://antmedia.io/docs/guides/developing-antmedia-server/webrtc-publish-page-creation-tutorial/)

47 changes: 35 additions & 12 deletions docs/guides/playing-live-stream/hls-playing.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,19 @@ HLS Playing is available in both the Community and Enterprise Editions. Before p

> Quick Link: [Learn How to Publish Live Streams](/docs/category/publish-live-stream/)
## 1. Navigate to the video player
## Navigate to the video player

Under the application, you can use play.html. Please go to ```https://AMS-domain-name:5443/WebRTCAppEE/play.html```. If you have Ant Media Server installed on your computer, you may also go to ```http://localhost:5080/WebRTCAppEE/play.html```.
You can use the embedded player `play.html` to play the streams with HLS.

To play an HLS stream, provide ```streamId``` as the name and ```hls``` as the playOrder parameters in the URL shown below.

```https://AMS-domain-name:5443/WebRTCAppEE/play.html?name=test&playOrder=hls```

![](@site/static/img/playing-live-streams/hls-playing/hls-player.png)

Please go to ```https://AMS-domain-name:5443/WebRTCAppEE/play.html```.

If you have Ant Media Server installed on your computer, you may also go to ```http://localhost:5080/WebRTCAppEE/play.html```.

## 2. Playback starts automatically
To play a HLS stream, provide ```streamId``` as the id and ```hls``` as the playOrder parameters in the URL shown below.

```https://AMS-domain-name:5443/WebRTCAppEE/play.html?id=test&playOrder=hls```

The HLS stream will start to play automatically when it becomes live.
The HLS playback will start automatically when the stream is live.

![](@site/static/img/playing-live-streams/hls-playing/hls-started.png)

Expand All @@ -45,15 +44,39 @@ Make sure HLS muxing is enabled in your application. You may confirm this by cli
Assume HLS muxing is enabled and a stream is published to Ant Media Server.

* Default HLS (.m3u8) URL:
```http://AMS-domain-or-IP:5080/LiveApp/streams/StreamId.m3u8```
```http://AMS-domain-or-IP:5080/WebRTCAppEE/streams/StreamId.m3u8```
* If adaptive bit rates are enabled in the application (Enterprise Edition), the HLS (.m3u8) URL will be as follows:
```http://AMS-domain-or-IP:5080/LiveApp/streams/StreamId_adaptive.m3u8```
```http://AMS-domain-or-IP:5080/WebRTCAppEE/streams/StreamId_adaptive.m3u8```

**Note:** Beginning with version 2.4.1, the filename structure included the bitrate in the name. For example, 480p ABR is enabled on the server and you want to play it.

In prior versions, the HLS filename was ```streamId_480p.m3u8```, but now it is ```stream1_480p1000kbps.m3u8```, as we enabled the same resolution with multiple bitrates.

If you would like to use the old structure, check the [following post](https://github.com/orgs/ant-media/discussions/4984).

## Interactive Streaming with ID3 Tags in HLS
Using `ID3` tags in HLS you can insert any kind of timed metadata, such as overlaying some text or images in specific moments to show comments, emojis, ads, markers, etc. where `ID3` is a data stream.

The feature to use `ID3` tags was introduced in Ant Media Server version 2.7.0

### Enabling ID3 Tags
In order to use the `ID3`, it is first needed to enable the `ID3` tags for the application.

It can be enabled from the `Advanced` settings by making `"id3TagEnabled": true` located under the application settings on the Ant Media Server Web Panel.

![](@site/static/img/playing-live-streams/hls-playing/enabling-id3.png)

### Adding ID3 Text
To insert an ID3 tag into any stream, just call the [REST method](https://antmedia.io/rest/#/BroadcastRestService/addID3Data) with your metadata and use that metadata in your player.
Below is a sample cURL command
```
curl -i -X POST -H "Accept: Application/json" -H "Content-Type: application/json" "https://{AMS-URL}:5443/{APP_NAME}/rest/v2/broadcasts/{STREAM_ID}/id3" -d '{TEXT}'
```
Checkout this [video tutorial](https://www.youtube.com/watch?v=Fq-a_tEXY4E&t=763s) where we discussed and demonstrated about ID3 tags.

**Note:** Currently ID3 Tags does not work with Ant Media Server default player (play.html) so you can use this [Codepen sample](https://codepen.io/Burak-Kekec/pen/PoXYMyG) for the testing.


## Save HLS Records

HLS streaming is a more cost-effective and secure method of streaming than video-on-demand assets. Furthermore, you can also record your live streams with HLS:
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/playing-live-stream/webrtc-playback.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Before playing a stream with WebRTC, make sure that stream is broadcasting on th

You can also use the URL format listed below to play the WebRTC stream using the Ant Media Server Embedded web player (play.html):

`https://AMS_domain_name:5443/WebRTCAppEE/play.html?name=streamId`
`https://AMS_domain_name:5443/WebRTCAppEE/play.html?id=streamId`

Check [Embedded Web Player](https://antmedia.io/docs/guides/playing-live-stream/embedded-web-player/) document for more information.

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified static/img/playing-live-streams/hls-playing/hls-started.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e360eb8

Please sign in to comment.