Skip to content

Document live playback access restrictions, enableRecording, and numeric media duration (1.1.0) - #6

Open
rohit-fastpix wants to merge 13 commits into
mainfrom
feature/spec-sync-live-restrictions
Open

Document live playback access restrictions, enableRecording, and numeric media duration (1.1.0)#6
rohit-fastpix wants to merge 13 commits into
mainfrom
feature/spec-sync-live-restrictions

Conversation

@rohit-fastpix

Copy link
Copy Markdown
Collaborator

FastPix Java SDK - Documentation PR

Documentation Changes

What Changed

  • New documentation added
  • Existing documentation updated
  • Documentation errors fixed
  • Code examples updated
  • Links and references updated
  • Other: CHANGELOG entry for 1.1.0

Files Modified

  • README.md
  • docs/ files
  • USAGE.md
  • CONTRIBUTING.md
  • Other: CHANGELOG.md, examples/LiveStreamingExample.java, tests/README.md

Summary

Brief description of changes:

Documents the 1.1.0 API sync:

- Media `duration` is now a number of seconds (`Optional<Double>`) instead of an
  "HH:MM:SS" string. Updated the field row on the 8 affected model pages
  (GetAllMediaResponse, GetMediaDetailResponse, LiveMediaClips, MediaClipResponseData,
  Media, UpdateMedia, SourceAccessMedia, PlaylistByIdResponseMediaListItem).
- New `enableRecording` field on InputMediaSettings; create-stream snippet in
  docs/sdks/streams shows it.
- New `accessRestrictions` field on PlaybackIdRequest, PlaybackIdSuccessResponseData,
  PlaybackSettings and PlaybackIdResponse; create-playback-ID snippet in
  docs/sdks/liveplayback shows it.
- Two new Live Playback operations, updateDomainRestrictions and
  updateUserAgentRestrictions, with full sections in docs/sdks/liveplayback/README.md,
  entries in its Available Operations list, 12 new model pages under
  docs/models/operations, and two bullets in the root README resource index.
- README install snippets (Gradle and Maven) bumped to 1.1.0.
- CHANGELOG entry with Breaking / Added / Fixed sections.
- LiveStreamingExample extended to create a stream with recording enabled, create a
  domain-restricted playback ID, and update its domain restrictions.
- tests/README.md: added the fixture setup/teardown flow and removed the embedded
  results snapshot.

Code Examples (if Applicable)

import java.util.List;

import io.fastpix.sdk.FastPixSDK;
import io.fastpix.sdk.models.components.BasicAccessPolicy;
import io.fastpix.sdk.models.components.PlaybackIdAccessRestrictions;
import io.fastpix.sdk.models.components.PlaybackIdDomains;
import io.fastpix.sdk.models.components.PlaybackIdRequest;
import io.fastpix.sdk.models.components.PolicyAction;
import io.fastpix.sdk.models.components.Security;
import io.fastpix.sdk.models.operations.CreatePlaybackIdOfStreamResponse;
import io.fastpix.sdk.models.operations.UpdateLiveStreamDomainRestrictionsRequestBody;
import io.fastpix.sdk.models.operations.UpdateLiveStreamDomainRestrictionsResponse;

public class Example {
    public static void main(String[] args) throws Exception {
        FastPixSDK sdk = FastPixSDK.builder()
                .security(Security.builder()
                        .username("your-access-token")
                        .password("your-secret-key")
                        .build())
                .build();

        // Create a live playback ID that only example.com may embed
        CreatePlaybackIdOfStreamResponse created = sdk.livePlayback()
                .createPlaybackId("your-stream-id", PlaybackIdRequest.builder()
                        .accessPolicy(BasicAccessPolicy.PUBLIC)
                        .accessRestrictions(PlaybackIdAccessRestrictions.builder()
                                .domains(PlaybackIdDomains.builder()
                                        .defaultPolicy(PolicyAction.DENY)
                                        .allow(List.of("example.com"))
                                        .build())
                                .build())
                        .build());

        // Update its domain restrictions later
        UpdateLiveStreamDomainRestrictionsResponse res = sdk.livePlayback()
                .updateDomainRestrictions("your-stream-id", "your-playback-id",
                        UpdateLiveStreamDomainRestrictionsRequestBody.builder()
                                .allow(List.of("example.com", "*.example.com"))
                                .deny(List.of("malicioussite.io"))
                                .build());
    }
}

Testing

  • All code examples tested
  • Links verified
  • Grammar checked
  • Formatting consistent

Review Checklist

  • Content is accurate
  • Code examples work
  • Links are working
  • Grammar is correct
  • Formatting is consistent

Ready for review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant