diff --git a/README.md b/README.md index b3626aa..33a5776 100644 --- a/README.md +++ b/README.md @@ -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' ) diff --git a/src/adapters/README.md b/src/adapters/README.md new file mode 100644 index 0000000..d717e45 --- /dev/null +++ b/src/adapters/README.md @@ -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. diff --git a/src/api/README.md b/src/api/README.md new file mode 100644 index 0000000..28ac867 --- /dev/null +++ b/src/api/README.md @@ -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. diff --git a/src/interfaces/README.md b/src/interfaces/README.md new file mode 100644 index 0000000..ca627f8 --- /dev/null +++ b/src/interfaces/README.md @@ -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.