The following section deals only with presenting the ClipShare functionality once you have performed a successful snap with the SnapOdds SDK.
Implementation
Perform Snap via SnapOdds SDK (refer to )
Ensure your class conforms to ClipShareFragmentResultListener
Instantiate ClipShareFragment with the required arguments
Handle the result in your listener implementation
Sharing Clips
The following code illustrates how to present the ClipShareFragment. The recommended way is to present this right after you get the callback from the SnapOdds SDK about a snapped sport event, which is also reflected in this code sample.
When the user successfully trims a desired clip, the following method is called in your ClipShareFragmentResultListener:
override fun clipShareFragmentDidCreateClip(fragment: ClipShareFragment, clip: Clip) {
// add desired behaviour here
}
When the clip could not be created for any reason, the following method is called in your ClipShareFragmentResultListener:
override fun clipShareFragmentDidFailCreatingClip(fragment: ClipShareFragment) {
// add desired behaviour here
}
When no clip information for the provided Snap Result could be loaded, the following method is called in your ClipShareFragmentResultListener:
override fun clipShareFragmentDidFailLoadingClip(fragment: ClipShareFragment) {
// add desired behaviour here
}
Additionally it is (very rarely) possible that the loaded clip is not long enough to support trimming. In that case the following method is called in your ClipShareFragmentResultListener:
override fun clipShareFragmentDidFailWithTooShortClip(fragment: ClipShareFragment) {
// add desired behaviour here
}