You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: hisplayer-api.md
+21Lines changed: 21 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -96,6 +96,21 @@ The following public APIs are provided by **HISPlayerManager**
96
96
***public struct HISPlayerCaptionElement**: The information of the triggered event turns into caption’s format.
97
97
***public int playerIndex**: The index of the player where the event is triggered.
98
98
***public string caption**: The next generated caption text.
99
+
100
+
***public struct HTTPHeader**: Information for a custom HTTP header:
101
+
***public string key**: Key of the HTTP header.
102
+
***public string value**: Value of the HTTP header.
103
+
104
+
***public class HTTPHeaderList**: Wrapper class for a list of custom HTTP headers.
105
+
***public List \<HTTPHeader\> headers**: List of HTTP headers.
106
+
***public int Count (Read-only)**: Number of HTTP headers.
107
+
***public void Add(string key, string value)**: Adds a new HTTP header given a **key** and a **value**.
108
+
***public void Add(HTTPHeader header)**: Adds an existing **HTTPHeader**.
109
+
***public bool Remove(string key)**: Removes the first header matching the given **key**. Returns true if a header was removed.
110
+
***public bool Remove(HTTPHeader header)**: Removes a specific **HTTPHeader**. Returns true if the header was removed.
111
+
***public void Clear()**: Removes all HTTP headers.
112
+
***public bool Contains(string key)**: Returns true if a header with the given **key** exists.
113
+
***public string Get(string key)**: Returns the value of the header matching the given **key**, or null if it does not exist.
99
114
100
115
## Functions
101
116
The following functions are provided by **HISPlayerManager**. They are **not public** so it’s necessary to create a custom script which inherits from **HISPlayerManager**.
@@ -318,6 +333,9 @@ Add new content to a certain player. If the **enableDRM** variable is true, a vi
Add new content to a certain player and its respective key server uri (tokenKey and tokenValue are optional parameters). The enableDRM variable must be true to use this function. The **playerIndex** is associated with the index of the element of **Multi Stream Properties**, e.g. the index 0 is the element 0 in the list. The **url** is the link to the new video. The keyServerUri is the token key associated with the URL. Please, make sure the string is correct. The **mimeType** parameter is optional and indicates which MIME type will be used for the new url.
Add new content to a certain player including custom HTTP headers. The **playerIndex** is associated with the index of the element of **Multi Stream Properties**, e.g. the index 0 is the element 0 in the list. The **url** is the link to the new video. Please, make sure the string is correct. This function supports local file paths. The **httpHeaderList** contains the custom HTTP headers that will be attached to the requests for this content. The parameter **mimeType** is optional and indicates which MIME type will be used for the new url.
338
+
321
339
#### void ChangeVideoContent(int playerIndex, int urlIndex)
322
340
Change the video’s URL of a certain player. The next playback will start paused if **autoPlay** is disabled. The **playerIndex** is associated with the index of the element of **Multi Stream Properties**, e.g. the index 0 is the element 0 in the list. The **urlIndex** is associated with the index of the element in the list of URLs.
323
341
@@ -330,6 +348,9 @@ Change the video’s URL of a certain player given a new URL. The next playback
Change the video’s URL of a certain player given a new URL with DRM protection (tokenKey and tokenValue are optional parameters). The next playback will start paused if **autoPlay** is disabled. The **playerIndex** is associated with the index of the element of **Multi Stream Properties**, e.g. the index 0 is the element 0 in the list. The parameter **url** is the link to the new video. The **keyServerUri** is the license key associated with the URL. Please, make sure the parameters are correctly written. This function supports local file paths. The **mimeType** parameter is optional and indicates which MIME type will be used for the new url.
Change the video's URL of a certain player given a new URL including custom HTTP headers. The next playback will start paused if **autoPlay** is disabled. The **playerIndex** is associated with the index of the element of **Multi Stream Properties**, e.g. the index 0 is the element 0 in the list. The parameter **url** is the link to the new video. Please, make sure the new URL is correctly written. This function supports local file paths. This function will replace the Playlist with the new URL. The **httpHeaderList** contains the custom HTTP headers that will be attached to the requests for this content.
353
+
333
354
#### void RemoveVideoContent(int playerIndex, int urlIndex)
334
355
Remove content from a certain player. The **playerIndex** is associated with the index of the element of **Multi Stream Properties**, e.g. the index 0 is the element 0 in the list. The **urlIndex** is associated with the index of the element in the list of URLs.
0 commit comments