# SVideos

**الأعضاء** 4

|      |                                                 |                                                                               |
| ---- | ----------------------------------------------- | ----------------------------------------------------------------------------- |
| دالة | [GetInventoryVideos](#getinventoryvideos)       | –                                                                             |
| دالة | [OpenUploadFileBrowser](#openuploadfilebrowser) | Opens a window that let's you select a file you wish to upload. (white-label) |
| دالة | [OnUploadEnd](#onuploadend)                     | Binds the function c to be called when an upload operation ends.              |
| دالة | [OnUploadStart](#onuploadstart)                 | Binds the function c to be called when an upload operation begins.            |

## الدوال

### GetInventoryVideos

Table GetInventoryVideos()

القيم المرجعة

`Table`

مثال

**Lua**

```lua
tableInventoryVideos = Space.Videos.GetInventoryVideos()

```

### OpenUploadFileBrowser

void OpenUploadFileBrowser()

Opens a window that let's you select a file you wish to upload. (white-label)

القيم المرجعة

`void`

مثال

**Lua**

```lua
Space.Videos.OpenUploadFileBrowser()

```

**Lua**

```lua
--this script will open a video upload window when clicked
thisObject = Space.Host.ExecutingObject

function OnClickFunction()
Space.Videos.OpenUploadFileBrowser()
end


thisObject.AddClickable()
thisObject.Clickable.Tooltip = "Click me to upload video"
thisObject.Clickable.OnClick(OnClickFunction)

```

### OnUploadEnd

void OnUploadEnd(Closure c)

Binds the function c to be called when an upload operation ends.

المعاملات

| الاسم | النوع   | القيمة الافتراضية |
| ----- | ------- | ----------------- |
| c     | Closure | –                 |

القيم المرجعة

`void`

مثال

**Lua**

```lua
function OnUploadEndFunction()
--
end
Space.Videos.OnUploadEnd(OnUploadEndFunction)

```

**Lua**

```lua
--this script will show a text on screen that says "Uploading..." when a video upload is initiated
--and will hide it when the upload has ended
thisObject = Space.Host.ExecutingObject
textObject = Space.Host.GetReference("textObject") --add a UIText object to References in Scripting Runtime
textObject.UIText.Text = "Uploading..."

function OnUploadStartFunction()
textObject.Active = true
end

function OnUploadEndFunction()
textObject.Active = false
end

Space.Videos.OnUploadStart(OnUploadStartFunction)
Space.Videos.OnUploadEnd(OnUploadEndFunction)

```

### OnUploadStart

void OnUploadStart(Closure c)

Binds the function c to be called when an upload operation begins.

المعاملات

| الاسم | النوع   | القيمة الافتراضية |
| ----- | ------- | ----------------- |
| c     | Closure | –                 |

القيم المرجعة

`void`

مثال

**Lua**

```lua
function OnUploadStartFunction()
--
end
Space.Videos.OnUploadStart(OnUploadStartFunction)

```

**Lua**

```lua
--this script will show a text on screen that says "Uploading..." when a video upload is initiated
--and will hide it when the upload has ended
thisObject = Space.Host.ExecutingObject
textObject = Space.Host.GetReference("textObject") --add a UIText object to References in Scripting Runtime
textObject.UIText.Text = "Uploading..."

function OnUploadStartFunction()
textObject.Active = true
end

function OnUploadEndFunction()
textObject.Active = false
end

Space.Videos.OnUploadStart(OnUploadStartFunction)
Space.Videos.OnUploadEnd(OnUploadEndFunction)

```
