DRM-X 6.0 dove 및 올리브 지점 로고DRM-X 6.0문서
◎ 한국어

Java, Spring Boot and Vue

Integrate protected video with Spring Security and a server-owned content catalog, then render it with Vue.

Markdown 보기실행 예제Updated 2026-09-15

재생이 승인되는 과정

백엔드가 시청 가능한 사용자를 결정합니다. DRM-X는 재생 승인 정보를 제공하며, 플레이어는 이를 사용해 DRM 라이선스를 요청합니다.

  1. 시청자

    서비스에 로그인하고 동영상 재생을 요청합니다.

  2. 고객 백엔드

    사용자의 구매 내역, 구독 상태 또는 기타 시청 권한을 확인합니다.

  3. DRM-X

    선택한 재생 규칙을 적용하고 재생 설정과 승인 정보를 반환합니다.

  4. 플레이어

    반환된 승인 정보를 사용해 재생에 필요한 DRM 라이선스를 요청합니다.

귀하의 백엔드가 접근을 결정합니다. DRM-X는 서명 된 정책을 시행합니다. 암호화 된 미디어 및 DRM 라이센스는 별도의 배송 경로를 따릅니다.

Build and configure the backend#

The sample uses Java 21, Spring Boot 3.5.11, Spring Security and JDBC. Build it with Maven. Set DRMX_SITE_ID, DRMX_SITE_KEY, DRMX_ACCESS_KEY and DRMX_INSTANCE_ID on the server. Bind a persistent database through DRMX_DATABASE_URL for deployment.

mvn test
mvn package
java -jar target/drmx-java-vue-1.3.0-SNAPSHOT.jar

The default H2 database is empty and held in memory. No demo account or content is authorized automatically. Connect your existing Spring Security account service, or provision users and authorities using Spring’s JdbcUserDetailsManager with encoded passwords.

Download third-party integration source

Connect your content and access rules#

Create drmx_video records with the published Content ID, content type, policy and enabled state. drmx_access binds a username to one video with start, expiry and revocation fields. VideoRepository.authorized checks these records for every request. Adapt this query to your existing course or subscription tables.

Keep the provided schema only for a new sample database. When integrating an existing production application, use your normal forward-only database migrations and disable automatic schema initialization.

Use the Vue component#

After signing in, fetch /api/drmx/videos/VIDEO_ID. Copy DrmxPlayer.vue and runtime.mjs from web-components, then pass the response contentId, contentType and sessionEndpoint to the component. It loads the pinned Shaka and Universal Player scripts automatically and replaces the old player when the selected video changes. Keep the player and authenticated session endpoint on the same origin.

The endpoint URL includes Spring Security’s CSRF token. Do not strip it when passing the URL to the component. The backend rechecks the video mapping and access before calling DRM-X. Local Java tests cover policy construction, enrollment, account isolation and revocation.