From eda09fe79ca16d42bd41931386a5d89bac366d86 Mon Sep 17 00:00:00 2001 From: Olivier Lando Date: Mon, 13 Nov 2023 18:10:53 +0100 Subject: [PATCH] README to documentation synchro --- .github/workflows/create-documentation-pr.yml | 27 +++++++++++ README.md | 46 ++++++++++++------- 2 files changed, 57 insertions(+), 16 deletions(-) create mode 100644 .github/workflows/create-documentation-pr.yml diff --git a/.github/workflows/create-documentation-pr.yml b/.github/workflows/create-documentation-pr.yml new file mode 100644 index 00000000..43978614 --- /dev/null +++ b/.github/workflows/create-documentation-pr.yml @@ -0,0 +1,27 @@ +name: Create documentation PR +on: + # Trigger the workflow on pull requests targeting the main branch + pull_request: + types: [assigned, unassigned, opened, reopened, synchronize, edited, labeled, unlabeled, edited, closed] + branches: + - main + +jobs: + create_documentation_pr: + if: github.event.action != 'closed' + + runs-on: ubuntu-latest + + steps: + - name: Check out current repository code + uses: actions/checkout@v2 + + - name: Create the documentation pull request + uses: apivideo/api.video-create-readme-file-pull-request-action@main + with: + source-file-path: "README.md" + destination-repository: apivideo/api.video-api-client-generator + destination-path: templates/documentation/sdks/player + destination-filename: apivideo-swift-player.md + pat: "${{ secrets.PAT }}" + \ No newline at end of file diff --git a/README.md b/README.md index a4b1f15a..6da325af 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ + [![badge](https://img.shields.io/twitter/follow/api_video?style=social)](https://twitter.com/intent/follow?screen_name=api_video)   [![badge](https://img.shields.io/github/stars/apivideo/api.video-swift-player?style=social)](https://github.com/apivideo/api.video-swift-player)   [![badge](https://img.shields.io/discourse/topics?server=https%3A%2F%2Fcommunity.api.video)](https://community.api.video) @@ -9,7 +10,7 @@ video APIs for integrating, scaling, and managing on-demand & low latency live streaming features in your app. -# Table of contents +## Table of contents - [Table of contents](#table-of-contents) - [Project description](#project-description) @@ -27,18 +28,31 @@ your app. - [Dependencies](#dependencies) - [FAQ](#faq) -# Project description + + +## Project description Easily integrate a video player for videos from [api.video](https://api.video) in your iOS application. ![](https://github.com/apivideo/api.video-swift-player/blob/main/Assets/player-preview.png) -# Getting started +## Getting started -## Installation +### Installation -### Swift Package Manager +#### Swift Package Manager In the Project Navigator select your own project. Then select the project in the Project section and click on the Package Dependencies tab. Click on the "+" button at the bottom. Paste the below url on the search bar on the top right. @@ -56,13 +70,13 @@ Or add this in your Package.swift ], ``` -### Cocoapods +#### Cocoapods Add `pod 'ApiVideoPlayer', '1.1.4'` in your `Podfile` Run `pod install` -## Retrieve your video Id +### Retrieve your video Id At this point, you must have uploaded a least one video to your account. If you haven't see [how to upload a video](https://docs.api.video/docs/upload-a-video-regular-upload). You'll need @@ -71,7 +85,7 @@ a video Id to use this component and play a video from api.video. To get yours, 1. [Log into your account](https://dashboard.api.video/login) or create one [here](https://dashboard.api.video/register). 2. Copy your API key (sandbox or production if you are subscribed to one of - our [plan](https://api.video/pricing)). + our [plan](https://api.video/pricing)/). 3. Go to [the official api.video documentation](https://docs.api.video/docs). 4. Log into your account in the top right corner. If it's already done, be sure it's the account you want to use. @@ -83,7 +97,7 @@ a video Id to use this component and play a video from api.video. To get yours, Alternatively, you can find your video Id in the video details of your [dashboard](https://dashboard.api.video). -## Usage +### Usage 1. Imports the library @@ -184,7 +198,7 @@ override func viewDidAppear(_ animated: Bool) { } ``` -### Remote control +#### Remote control If you want to enable the remote control do the following: @@ -199,7 +213,7 @@ When you have to remove it set `enableRemoteControl` to false By default the remote control is hidden. -### Supported player views +#### Supported player views The api.video Swift player comes with a specific view `ApiVideoPlayerView` to display the video and its controller. If you require a customization of this view such as changing a button color,..., @@ -232,7 +246,7 @@ controller.play() - [`AVPlayerLayer`](https://developer.apple.com/documentation/avfoundation/avplayerlayer). A view that only display the video. It requires more work to be used. -## Play an api.video video in your AVPlayer +### Play an api.video video in your AVPlayer If you are using AVPlayer directly, you can use the api.video Swift extensions: @@ -250,7 +264,7 @@ val player = AVPlayer() // You already have that in your code avPlayer.replaceCurrentItem(withHls: videoOptions) ``` -# Sample application +## Sample application A demo application demonstrates how to use player. See [`/example`](https://github.com/apivideo/api.video-swift-player/tree/main/Examples) @@ -260,12 +274,12 @@ On the first run, you will have to set your video Id: 1. Replace "YOUR_VIDEO_ID" by your video Id -# Documentation +## Documentation - [Player documentation](https://apivideo.github.io/api.video-swift-player/documentation/apivideoplayer/) - [api.video documentation](https://docs.api.video) -# Dependencies +## Dependencies We are using external library @@ -273,7 +287,7 @@ We are using external library | --------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | | [ApiVideoPlayerAnalytics](https://github.com/apivideo/api.video-swift-player-analytics) | [README.md](https://github.com/apivideo/api.video-swift-player-analytics#readme) | -# FAQ +## FAQ If you have any questions, ask us here: [https://community.api.video](https://community.api.video) or use [Issues](https://github.com/apivideo/api.video-swift-player/issues).