Skip to content

libvlc.PlayList.Operator_Subscript

Andrew Lambert edited this page Nov 26, 2022 · 3 revisions

libvlc.PlayList.Operator_Subscript

Method signatures

 Function Operator_Subscript(Index As Integer) As libvlc.Medium
 Sub Operator_Subscript(Index As Integer, Assigns NewMedia As libvlc.Medium)

Remarks

Gets and sets the Medium at index in the PlayList. If there is no item at Index then an OutOfBoundsException will be raised.

Operator_Subscript is invoked when you use array-access syntax on an instance of a class. For example, in the expression SomeObject(1), the subscript is (1).

Syntax example

This example adds two media streams to the playlist and then swaps their order in the list:

  Dim list As New libvlc.PlayList
  list.Append("http://www.example.com/movie1.mp4")
  list.Append(GetFolderItem("C:\example\movie2.avi"))
  
  ' swap playlist items using array syntax
  Dim tmp As libvlc.Medium = list(1)
  list(1) = list(0)
  list(0) = tmp
Clone this wiki locally