Skip to content

Commit 7720a6d

Browse files
Update hls-downloader.md
1 parent 79f82c9 commit 7720a6d

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

hls-downloader.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,55 @@ public class HISPlayeriOSDownloaderSample : HISPlayerManager
8686
}
8787
}
8888
```
89+
90+
# Related API
91+
92+
### Event and Virtual Options
93+
94+
* **public enum HISPlayerEvent**: The list of events provided by HISPlayer SDK for using HLS Downloader functionalities. The events can be used with the virtual functions in the next section:
95+
* **HISPLAYER_EVENT_DOWNLOAD_COMPLETED**
96+
* **HISPLAYER_EVENT_DOWNLOAD_PROGRESS**
97+
#### protected virtual void EventOnDownloadCompleted(HISPlayerEventInfo eventInfo)
98+
Override this method to add custom logic when **HISPlayerEvent.HISPLAYER_EVENT_DOWNLOAD_COMPLETED** is triggered.
99+
This event occurs whenever a stream that was being downloaded has ended the download process, and it's ready to be played.
100+
101+
<table>
102+
<tr>
103+
<th>Name</th>
104+
<th>Description</th>
105+
</tr>
106+
<tr>
107+
<td>stringInfo</td>
108+
<td>Relative path where the stream has been stored. This will equal to the title settled to the video. The path is relative to the Application.persistentDataPath,which in iOS corresponds to /var/mobile/Containers/Data/Application/<guid>/Documents. Save it for later plaback of such stream.</td>
109+
</tr>
110+
</table>
111+
112+
#### protected virtual void EventOnDownloadProgress(HISPlayerEventInfo eventInfo)
113+
Override this method to add custom logic when **HISPlayerEvent.HISPLAYER_EVENT_DOWNLOAD_PROGRESS** is triggered.
114+
This event occurs whenever a HLS stream is being downloaded, to retrieve the progress of such download.
115+
116+
<table>
117+
<tr>
118+
<th>Name</th>
119+
<th>Description</th>
120+
</tr>
121+
<tr>
122+
<td>param1</td>
123+
<td>The percentage of the download progress of a certain stream.</td>
124+
</tr>
125+
<tr>
126+
<td>stringInfo</td>
127+
<td>Title of the stream that is being downloaded. This title is settled by the user when calling the DownloadStream API.</td>
128+
</tr>
129+
</table>
130+
131+
### Non-virtual Functions
132+
133+
#### public void DownloadStream(string url, string videoTitle)
134+
Download an HLS Stream. Stream will be automatically saved on the Application.PersisentDataPath (/var/mobile/Containers/Data/Appligation/<guid>/Documents). If 2 downloaded contents have the same video title, the last one will overrite the first one. Avoid using non english characters, dots, slashes and any other kind of special character. The **url** refers to the URL to the HLS stream. **videoTitle** is the name of the saved stream and will allow to reproduce it once it has been downloaded.
135+
136+
#### public void DeleteDownloadStream(string videoTitle)
137+
Delete a specific downloaded HLS Stream. **videoTitle** is the name of the stream that will be deleted from the device.
138+
139+
#### public void DeleteAllDownloadedStreams()
140+
Delete all downloaded streams that have been stored in the Application.PersistentDataPath.

0 commit comments

Comments
 (0)