# Events

The MediaPlayer exposes various convenient events]\(/api/kendo.mvc.ui.fluent/mediaplayereventbuilder) that you can handle.

For a complete example on basic MediaPlayer events, refer to the [demo on using the events of the MediaPlayer](https://demos.telerik.com/aspnet-mvc/mediaplayer/events).

## Handling by Handler Name

The following example demonstrates how to subscribe to events by a handler name.

```Razor HtmlHelper
        @(Html.Kendo().MediaPlayer()
          .Name("mediaplayer")
          .Events(e => e
                .Pause("mediaplayer_pause")
          )
        )
        <script>
        function mediaplayer_pause() {
            // Handle the pause event.
        }
        </script>
```

## Handling by Template Delegate

The following example demonstrates how to subscribe to events by a template delegate.

```Razor HtmlHelper
  @(Html.Kendo().MediaPlayer()
    .Name("mediaplayer")
    .Events(e => e
        .Pause(@<text>
          function() {
              // Handle the pause event inline.
          }
        </text>)
    )
  )
```

## Next Steps

* [MediaPlayer Basic Usage (Demo)](https://demos.telerik.com/aspnet-mvc/mediaplayer)

## See Also

* [Using the API of the MediaPlayer HtmlHelper for ASP.NET MVC (Demo)](https://demos.telerik.com/aspnet-mvc/mediaplayer/api)
* [Server-Side API of the MediaPlayer](https://www.telerik.com/aspnet-mvc/documentation/api/mediaplayer)
* [Client-Side API of the MediaPlayer](https://docs.telerik.com/kendo-ui/api/ui/mediaplayer)
