Skip to content

Commit

Permalink
provide base README documentation outlining class methods
Browse files Browse the repository at this point in the history
  • Loading branch information
manewc committed Oct 1, 2024
1 parent 0bb364a commit 020ded3
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ use DateInterval;
use DateTimeImmutable;
use WP_Query;

add_action( 'plugins_loaded', function () => {
add_action( 'plugins_loaded', function () {
$sync_manager = Sync_Manager::init()
->with_adapter( new JW_Player_7_For_WP() )
->with_frequency( 'hourly' )
Expand Down
28 changes: 28 additions & 0 deletions src/adapters/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
## Class JW_Player

This class will implement the base `Adapter` interface. Instantiating this class with a `JW_Player_API` object will allow the request to be made to get the latest videos to be synced. This class may be used to work with a theme's custom integration with JW Player.

Example Integration:

```shell
\Alley\WP\WP_Video_Sync\Sync_Manager::init()
->with_adapter(
new \Alley\WP\WP_Video_Sync\Adapters\JW_Player(
new \Alley\WP\WP_Video_Sync\API\JW_Player_API(
[PROPERTY_ID],
[API_KEY]
)
)
)
->with_batch_size()
->with_frequency()
->with_callback(
function ( $video ) {
// Do something with the video.
}
);
```

## Class JW_Player_7_For_WP

This class is to work with the JW Player 7 for WordPress plugin.
7 changes: 7 additions & 0 deletions src/api/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## Class JW_Player_API

This class is used for constructing an object for making an API call to the JW Player API. Simply pass your API key and API Secret on instantiation. Please reference the interface `API_Requester` for the required methods. This object may be used to pass to the `JW_Player` adapter.

## Class Request

This class will handle the generation of the URL for performing an API request. The API response will call the `parse_response` method which will subsequently call the `parse_success()` or `parse_error()` method of the `API_Requester` object that is used to construct this object.
7 changes: 7 additions & 0 deletions src/interfaces/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## Class Adapter

Adhere to the Adapter interface to create a new adapter for syncing videos.

## Class API_Request

Adhere to the API_Request interface to provide the necesssary methods for making and processing an API request.

0 comments on commit 020ded3

Please sign in to comment.