Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,7 @@ The player instance exposes the following methods, accessible when the player is
| `mute()` | - | - | Mute the volume |
| `unMute()` | - | - | Unmute the volume |
| `seekTo(time)` | `Number` | - | Seek to a current time in seconds |
| `setSource(source)` | `String` | - | Set the media source |
| `requestFullscreen()` | - | - | Request the fullscreen |
| `exitFullscreen()` | - | - | Exit the fullscreen |
| `getInstance()` | - | - | Get the player instance |
Expand Down
9 changes: 9 additions & 0 deletions src/providers/html5/html5.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,15 @@ export default function Html5Provider(Player: any) {
})
}

/**
* Set the media source
* @param source New media source URL
*/
setSource(source: string) {
this.media.src = source
this.media.load()
}

/**
* Create event listeners
* All listeners are created on class properties to facilitate the deletion of events
Expand Down