> For the complete documentation index, see [llms.txt](https://pub-star.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://pub-star.gitbook.io/docs/1.5.1/flutter-sdk/video.md).

# Video

Load and immediately show an Video ads by ID.

### API

| Props      | Function                                                                                                 |
| ---------- | -------------------------------------------------------------------------------------------------------- |
| `adId`     | id of Video ad                                                                                           |
| `media`    | url of media video                                                                                       |
| `onError`  | call when show ad failed. return object type `PubstarError`                                              |
| `onHide`   | call when ad hidden/closed (supports rewarded ads). Returns detailed PubstarReward object (type, amount) |
| `onLoaded` | call when ad loaded                                                                                      |
| `onShowed` | call when ad showed                                                                                      |

### Example

```dart
PubstarVideoAdView(
  adId: adId,
  media:
      'https://storage.googleapis.com/gvabox/media/samples/stock.mp4',
  onError:
      (error) {
          // callback when ads error
      },
  onHide:
      (reward) {
          // callback when ad hide with reward option
      },
  onLoaded: () {
      // callback when ad loaded
  },
  onShowed: () {
      // callback when ad showed
  },
)
```
