Skip to content

Commit

Permalink
update version, README (#19)
Browse files Browse the repository at this point in the history
* update version, README

* address comments

* update v1 usage
  • Loading branch information
shwetamurthy20 committed May 17, 2021
1 parent 4fcd3ba commit 7897f67
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 7 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## 1.0.0

* Add the following V2 clients-
Advertising, Analytics, Channels, Events, Imports, Media, Playlists, Protection Rules, Uploads, VPB Configs, Webhooks
* Rename V1 client package from com.jwplayer.jwplatform.client to com.jwplayer.jwplatform.v1 _This is a Breaking change_
* Update README to include usage documentation for V2 client.

## 0.4.0

* Stop using nested exception handling
Expand Down
58 changes: 52 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,71 @@ for more information about JW Platform API.

Java 8 and later.

## Install With Maven:
# Install With Maven:

Add this dependency to your project's POM:

```xml
<dependency>
<groupId>com.jwplayer</groupId>
<artifactId>jwplatform</artifactId>
<version>0.4.0</version>
<version>1.0.0</version>
</dependency>
```

# V2 Client ##

## Usage

The following is an example of how to use the client for a video of sourcetype `url`:
The following is an example of how to use the V2 client, MediaClient, used to access all media v2 api routes:

```java

import com.jwplayer.jwplatform.JWPlatformClient;
import java.util.HashMap;
import java.util.Map;

import org.json.JSONArray;
import org.json.JSONObject;

import com.jwplayer.jwplatform.client.MediaClient;
import com.jwplayer.jwplatform.exception.JWPlatformException;

public class Example {

public static void main(String[] args) {
String apiSecret = "secret";

try {
MediaClient client = MediaClient.getClient(apiSecret);

// Query params
Map<String, String> params = new HashMap<>();
params.put("page_length", "10");
JSONObject listMediaResponse = client.listAllMedia("yourSiteId", params);
System.out.println(listMediaResponse);

// Show the list of media for the site Id
JSONArray media = (JSONArray) listMediaResponse.getJSONArray("media");
System.out.println(media);
} catch (JWPlatformException e) {
e.printStackTrace();
}
}
}

```

## V1 Client ##

The V1 Client remains available for use, but is deprecated. **We strongly recommend using the V2 Client.**

## Usage

The following is an example of how to use the V1 client for a video of sourcetype `url`:

```java

import com.jwplayer.jwplatform.v1.JWPlatformClient;
import com.jwplayer.jwplatform.exception.JWPlatformException;
import java.util.HashMap;
import java.util.Map;
Expand Down Expand Up @@ -111,12 +157,12 @@ public class JWPlatformClientExample {
```
_**Note**_

In the preceding snippets, all URL paths feature a leading slash. These must be included
In the preceding **V1 example** snippets, all URL paths feature a leading slash. These must be included
for the URL builder to work properly.

## Supported operations

All API methods documentated on the API are available in this client.
All API methods documented in our api documentation are available in this client.
Please refer to our [api documentation](https://developer.jwplayer.com/jwplayer/reference).

## ChangeLog
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.jwplayer</groupId>
<artifactId>jwplatform</artifactId>
<version>0.4.0</version>
<version>1.0.0</version>
<packaging>jar</packaging>

<name>JWPlatform-Java</name>
Expand Down

0 comments on commit 7897f67

Please sign in to comment.