# Source

Media source state and actions for the player store

Tracks the loaded media resource and how much of it is ready. To change the source, set `src` or `source` on the media component, which also carries type and engine configuration.

## Import

```ts
import { sourceFeature } from '@videojs/html';
```

The `audioFeatures`, `liveAudioFeatures`, `liveVideoFeatures`, and `videoFeatures` [feature bundles](../../guides/presets.md) include this feature.

## API Reference

### State

| Property | Type | Description |
| --- | --- | --- |
| `currentSrc` | `string` | Current media source URL (empty string if none). |
| `canPlay` | `boolean` | Whether enough data is loaded to begin playback. |

### Selector

Pass `selectSource` to [`PlayerController`](./player-controller.md) to subscribe to source state. Returns `undefined` if the source feature is not configured.

**source-info.ts**

```ts
import { createPlayer, UIElement, selectSource } from '@videojs/html';
import { videoFeatures } from '@videojs/html/video';

const { PlayerController } = createPlayer({ features: videoFeatures });

class SourceInfo extends UIElement {
  readonly #source = new PlayerController(this, selectSource);
}
```