# Moodle protected-video activities

Create a Moodle activity that binds one published Content ID to Moodle enrollment and activity-access rules.

Cara pemutaran diotorisasi

Backend Anda menentukan siapa yang boleh menonton. DRM-X memberikan otorisasi pemutaran. Pemutar menggunakannya untuk meminta lisensi DRM.

- 01**Penonton**

Masuk ke layanan Anda dan meminta video.

- 02**Backend Anda**

Memeriksa pembelian, langganan, atau izin menonton lainnya milik pengguna.

- 03**DRM-X**

Menerapkan aturan yang dipilih dan mengembalikan konfigurasi serta otorisasi pemutaran.

- 04**Pemutar**

Menggunakan otorisasi yang diterima untuk meminta lisensi DRM yang diperlukan untuk pemutaran.

Backend Anda memutuskan akses; DRM-X memaksa kebijakan yang ditandatangani. Media tersandi dan DRM lisensi mengikuti jalur pengiriman terpisah.

## Install the activity module[#](#install)



Install mod_drmx in Moodle through Site administration → Plugins → Install plugins. The plugin directory is mod/drmx. Complete the Moodle database upgrade, then open the DRM-X protected video activity settings.



Enter Site ID, Site Key, Access Key and the default license policy. For managed deployments, use Moodle forced_plugin_settings to inject these settings from protected host configuration.



[Download the Moodle activity module](https://drm-x6-cdn.1aicloud.com/drmx-moodle-activity-1.3.0-preview.2-731c835e4918.zip)





## Create a protected-video activity[#](#activity)



Turn editing on in a course and add DRM-X Protected Video. In the DRM-X 6.0 Universal Player section, paste the published Content ID, select VOD or Live and choose a protection policy. The question-mark help explains each field; policy names include their API identifiers. Save and display, then test as a learner. Configure availability and completion using Moodle activity settings.



Every playback request checks the signed-in account, course enrollment, mod/drmx:view capability, and the visibility of this activity to that user. The requested Content ID must match the saved activity. Guests, suspended enrollments and unavailable activities are denied.



Completion tracking records that the activity was viewed. It does not prove that the learner watched the entire video.





## Embed an existing activity with the filter[#](#filter)



Install filter_drmx after mod_drmx, then enable it in Manage filters. Use the course-module ID from the activity URL, not the internal video record ID.



```
{drmx activityid="123"}
```



Older contentid markup resolves only when exactly one DRM-X activity in the current course has that Content ID and content type. Copy credentials from the old filter settings into the activity settings; the old filter credential fields are no longer used.



[Download the optional Moodle filter](https://drm-x6-cdn.1aicloud.com/drmx-moodle-filter-1.3.0-preview.1-8c90b1cbfeae.zip)





## Backups, restoration and testing[#](#restore)



The activity includes Moodle backup and restore handlers. Restoring an activity clears Content ID so an administrator must confirm the destination mapping before playback is enabled. Do not restore server credentials through course backups.



Moodle 5.2.2+ was installed locally and tested for activity binding, an altered Content ID, hidden activities and suspended enrollment. Test your own role overrides, group/date restrictions, backup restoration and actual DRM playback before rollout.

<!-- Canonical: https://docs.drm-x.com/id/integrations/moodle-activity -->
<!-- Language: id -->
