New to Telerik UI for ASP.NET Core? Start a free 30-day trial

Defines the fluent API for configuring the Kendo UI MediaPlayer for ASP.NET MVC events.

Definition

Constructors

Initializes a new instance of the MediaPlayerEventBuilder class.

C#
public MediaPlayerEventBuilder(IDictionary<string, object> events)
Parameters:eventsIDictionary<string, object>

The MediaPlayer event handlers.

Methods

Defines the handler of the End client-side event. Fires when the media finishes playing.The event handler function context (available via the this keyword) will be set to the widget instance.

C#
public MediaPlayerEventBuilder End(Func<object, object> handler)
Parameters:handlerFunc<object, object>

The handler code wrapped in a text tag.

Returns:

MediaPlayerEventBuilder

Returns the current instance of MediaPlayerEventBuilder .

Example:
C#
@(Html.Kendo().MediaPlayer()
.Name("mediaPlayer")
.Events(e =&gt; e.End(
@&lt;text&gt;
function(e) {
// event handling code
}
&lt;/text&gt;
))
)

Defines the handler of the End client-side event. Fires when the media finishes playing.The event handler function context (available via the this keyword) will be set to the widget instance.

C#
public MediaPlayerEventBuilder End(string handler)
Parameters:handlerstring

The name of the JavaScript function that will handle the End event.

Returns:

MediaPlayerEventBuilder

Returns the current instance of MediaPlayerEventBuilder .

Example:
C#
@(Html.Kendo().MediaPlayer()
.Name("mediaPlayer")
.Events(e =&gt; e.End("onEnd"))
)

Defines the handler of the KendoKeydown client-side event. Triggered when the user presses a keyboard key while the MediaPlayer is focused.The event handler function context (available via the this keyword) will be set to the widget instance.

C#
public MediaPlayerEventBuilder KendoKeydown(Func<object, object> handler)
Parameters:handlerFunc<object, object>

The handler code wrapped in a text tag.

Returns:

MediaPlayerEventBuilder

Returns the current instance of MediaPlayerEventBuilder .

Defines the handler of the KendoKeydown client-side event. Triggered when the user presses a keyboard key while the MediaPlayer is focused.The event handler function context (available via the this keyword) will be set to the widget instance.

C#
public MediaPlayerEventBuilder KendoKeydown(string handler)
Parameters:handlerstring

The name of the JavaScript function that will handle the KendoKeydown event.

Returns:

MediaPlayerEventBuilder

Returns the current instance of MediaPlayerEventBuilder .

Defines the handler of the Pause client-side event. Fires when the media is paused.The event handler function context (available via the this keyword) will be set to the widget instance.

C#
public MediaPlayerEventBuilder Pause(Func<object, object> handler)
Parameters:handlerFunc<object, object>

The handler code wrapped in a text tag.

Returns:

MediaPlayerEventBuilder

Returns the current instance of MediaPlayerEventBuilder .

Example:
C#
@(Html.Kendo().MediaPlayer()
.Name("mediaPlayer")
.Events(e =&gt; e.Pause(
@&lt;text&gt;
function(e) {
// event handling code
}
&lt;/text&gt;
))
)

Defines the handler of the Pause client-side event. Fires when the media is paused.The event handler function context (available via the this keyword) will be set to the widget instance.

C#
public MediaPlayerEventBuilder Pause(string handler)
Parameters:handlerstring

The name of the JavaScript function that will handle the Pause event.

Returns:

MediaPlayerEventBuilder

Returns the current instance of MediaPlayerEventBuilder .

Example:
C#
@(Html.Kendo().MediaPlayer()
.Name("mediaPlayer")
.Events(e =&gt; e.Pause("onPause"))
)

Defines the handler of the Play client-side event. Fires when the media begins playing.The event handler function context (available via the this keyword) will be set to the widget instance.

C#
public MediaPlayerEventBuilder Play(Func<object, object> handler)
Parameters:handlerFunc<object, object>

The handler code wrapped in a text tag.

Returns:

MediaPlayerEventBuilder

Returns the current instance of MediaPlayerEventBuilder .

Example:
C#
@(Html.Kendo().MediaPlayer()
.Name("mediaPlayer")
.Events(e =&gt; e.Play(
@&lt;text&gt;
function(e) {
// event handling code
}
&lt;/text&gt;
))
)

Defines the handler of the Play client-side event. Fires when the media begins playing.The event handler function context (available via the this keyword) will be set to the widget instance.

C#
public MediaPlayerEventBuilder Play(string handler)
Parameters:handlerstring

The name of the JavaScript function that will handle the Play event.

Returns:

MediaPlayerEventBuilder

Returns the current instance of MediaPlayerEventBuilder .

Example:
C#
@(Html.Kendo().MediaPlayer()
.Name("mediaPlayer")
.Events(e =&gt; e.Play("onPlay"))
)

Defines the handler of the Ready client-side event. Fires when loading is over and the widget is ready to start playing the media.The event handler function context (available via the this keyword) will be set to the widget instance.

C#
public MediaPlayerEventBuilder Ready(Func<object, object> handler)
Parameters:handlerFunc<object, object>

The handler code wrapped in a text tag.

Returns:

MediaPlayerEventBuilder

Returns the current instance of MediaPlayerEventBuilder .

Example:
C#
@(Html.Kendo().MediaPlayer()
.Name("mediaPlayer")
.Events(e =&gt; e.Ready(
@&lt;text&gt;
function(e) {
// event handling code
}
&lt;/text&gt;
))
)

Defines the handler of the Ready client-side event. Fires when loading is over and the widget is ready to start playing the media.The event handler function context (available via the this keyword) will be set to the widget instance.

C#
public MediaPlayerEventBuilder Ready(string handler)
Parameters:handlerstring

The name of the JavaScript function that will handle the Ready event.

Returns:

MediaPlayerEventBuilder

Returns the current instance of MediaPlayerEventBuilder .

Example:
C#
@(Html.Kendo().MediaPlayer()
.Name("mediaPlayer")
.Events(e =&gt; e.Ready("onReady"))
)

Defines the handler of the TimeChange client-side event. Fires when the user selects a new play time.The event handler function context (available via the this keyword) will be set to the widget instance.

C#
public MediaPlayerEventBuilder TimeChange(Func<object, object> handler)
Parameters:handlerFunc<object, object>

The handler code wrapped in a text tag.

Returns:

MediaPlayerEventBuilder

Returns the current instance of MediaPlayerEventBuilder .

Example:
C#
@(Html.Kendo().MediaPlayer()
.Name("mediaPlayer")
.Events(e =&gt; e.TimeChange(
@&lt;text&gt;
function(e) {
// event handling code
}
&lt;/text&gt;
))
)

Defines the handler of the TimeChange client-side event. Fires when the user selects a new play time.The event handler function context (available via the this keyword) will be set to the widget instance.

C#
public MediaPlayerEventBuilder TimeChange(string handler)
Parameters:handlerstring

The name of the JavaScript function that will handle the TimeChange event.

Returns:

MediaPlayerEventBuilder

Returns the current instance of MediaPlayerEventBuilder .

Example:
C#
@(Html.Kendo().MediaPlayer()
.Name("mediaPlayer")
.Events(e =&gt; e.TimeChange("onTimeChange"))
)

Defines the handler of the VolumeChange client-side event. This event is fired upon changing the volume level.The event handler function context (available via the this keyword) will be set to the widget instance.

C#
public MediaPlayerEventBuilder VolumeChange(Func<object, object> handler)
Parameters:handlerFunc<object, object>

The handler code wrapped in a text tag.

Returns:

MediaPlayerEventBuilder

Returns the current instance of MediaPlayerEventBuilder .

Example:
C#
@(Html.Kendo().MediaPlayer()
.Name("mediaPlayer")
.Events(e =&gt; e.VolumeChange(
@&lt;text&gt;
function(e) {
// event handling code
}
&lt;/text&gt;
))
)

Defines the handler of the VolumeChange client-side event. This event is fired upon changing the volume level.The event handler function context (available via the this keyword) will be set to the widget instance.

C#
public MediaPlayerEventBuilder VolumeChange(string handler)
Parameters:handlerstring

The name of the JavaScript function that will handle the VolumeChange event.

Returns:

MediaPlayerEventBuilder

Returns the current instance of MediaPlayerEventBuilder .

Example:
C#
@(Html.Kendo().MediaPlayer()
.Name("mediaPlayer")
.Events(e =&gt; e.VolumeChange("onVolumeChange"))
)