Positions the playhead.
For media containing keyframes, the playhead is positioned at the nearest previous keyframe.
This means that for media using inter-frame compression (where decoding requires information from previous or forward frames), the granularity of frames that can be accurately seeked to depends largely on the codec used and its specific settings.
If the playback is stopped, the state is changed to paused.
Only one of `position`, `mediaPosition` or `normalizedPosition` parameters is allowed, but not both at the same time.
curl -X POST \
-H "Accept: application/json" \
"http://192.168.2.140/api/core/v1/players/{playerIndex}/{playbackName}/seek?position=0.0&mediaPosition=0.0&normalizedPosition=0.0"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.CoreApi;
import java.io.File;
import java.util.*;
public class CoreApiExample {
public static void main(String[] args) {
// Create an instance of the API class
CoreApi apiInstance = new CoreApi();
Integer playerIndex = 56; // Integer | The player index starting from one
String playbackName = playbackName_example; // String | The playback name `program` or `preview`
BigDecimal position = 0.0; // BigDecimal | The seek position in seconds from inpoint to endpoint.
BigDecimal mediaPosition = 0.0; // BigDecimal | The seek position in seconds from start of media.
BigDecimal normalizedPosition = 0.0; // BigDecimal | The normalized seek position between inpoint (0.0) and outpoint (1.0)
try {
apiInstance.seek(playerIndex, playbackName, position, mediaPosition, normalizedPosition);
} catch (ApiException e) {
System.err.println("Exception when calling CoreApi#seek");
e.printStackTrace();
}
}
}
import 'package:openapi/api.dart';
final api_instance = DefaultApi();
final Integer playerIndex = new Integer(); // Integer | The player index starting from one
final String playbackName = new String(); // String | The playback name `program` or `preview`
final BigDecimal position = new BigDecimal(); // BigDecimal | The seek position in seconds from inpoint to endpoint.
final BigDecimal mediaPosition = new BigDecimal(); // BigDecimal | The seek position in seconds from start of media.
final BigDecimal normalizedPosition = new BigDecimal(); // BigDecimal | The normalized seek position between inpoint (0.0) and outpoint (1.0)
try {
final result = await api_instance.seek(playerIndex, playbackName, position, mediaPosition, normalizedPosition);
print(result);
} catch (e) {
print('Exception when calling DefaultApi->seek: $e\n');
}
import org.openapitools.client.api.CoreApi;
public class CoreApiExample {
public static void main(String[] args) {
CoreApi apiInstance = new CoreApi();
Integer playerIndex = 56; // Integer | The player index starting from one
String playbackName = playbackName_example; // String | The playback name `program` or `preview`
BigDecimal position = 0.0; // BigDecimal | The seek position in seconds from inpoint to endpoint.
BigDecimal mediaPosition = 0.0; // BigDecimal | The seek position in seconds from start of media.
BigDecimal normalizedPosition = 0.0; // BigDecimal | The normalized seek position between inpoint (0.0) and outpoint (1.0)
try {
apiInstance.seek(playerIndex, playbackName, position, mediaPosition, normalizedPosition);
} catch (ApiException e) {
System.err.println("Exception when calling CoreApi#seek");
e.printStackTrace();
}
}
}
// Create an instance of the API class
CoreApi *apiInstance = [[CoreApi alloc] init];
Integer *playerIndex = 56; // The player index starting from one (default to null)
String *playbackName = playbackName_example; // The playback name `program` or `preview` (default to null)
BigDecimal *position = 0.0; // The seek position in seconds from inpoint to endpoint. (optional) (default to null)
BigDecimal *mediaPosition = 0.0; // The seek position in seconds from start of media. (optional) (default to null)
BigDecimal *normalizedPosition = 0.0; // The normalized seek position between inpoint (0.0) and outpoint (1.0) (optional) (default to null)
// Seeks inside the current media
[apiInstance seekWith:playerIndex
playbackName:playbackName
position:position
mediaPosition:mediaPosition
normalizedPosition:normalizedPosition
completionHandler: ^(NSError* error) {
if (error) {
NSLog(@"Error: %@", error);
}
}];
var AnalogWayCoreApi = require('analog_way_core_api');
// Create an instance of the API class
var api = new AnalogWayCoreApi.CoreApi()
var playerIndex = 56; // {Integer} The player index starting from one
var playbackName = playbackName_example; // {String} The playback name `program` or `preview`
var opts = {
'position': 0.0, // {BigDecimal} The seek position in seconds from inpoint to endpoint.
'mediaPosition': 0.0, // {BigDecimal} The seek position in seconds from start of media.
'normalizedPosition': 0.0 // {BigDecimal} The normalized seek position between inpoint (0.0) and outpoint (1.0)
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully.');
}
};
api.seek(playerIndex, playbackName, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class seekExample
{
public void main()
{
// Create an instance of the API class
var apiInstance = new CoreApi();
var playerIndex = 56; // Integer | The player index starting from one (default to null)
var playbackName = playbackName_example; // String | The playback name `program` or `preview` (default to null)
var position = 0.0; // BigDecimal | The seek position in seconds from inpoint to endpoint. (optional) (default to null)
var mediaPosition = 0.0; // BigDecimal | The seek position in seconds from start of media. (optional) (default to null)
var normalizedPosition = 0.0; // BigDecimal | The normalized seek position between inpoint (0.0) and outpoint (1.0) (optional) (default to null)
try {
// Seeks inside the current media
apiInstance.seek(playerIndex, playbackName, position, mediaPosition, normalizedPosition);
} catch (Exception e) {
Debug.Print("Exception when calling CoreApi.seek: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\CoreApi();
$playerIndex = 56; // Integer | The player index starting from one
$playbackName = playbackName_example; // String | The playback name `program` or `preview`
$position = 0.0; // BigDecimal | The seek position in seconds from inpoint to endpoint.
$mediaPosition = 0.0; // BigDecimal | The seek position in seconds from start of media.
$normalizedPosition = 0.0; // BigDecimal | The normalized seek position between inpoint (0.0) and outpoint (1.0)
try {
$api_instance->seek($playerIndex, $playbackName, $position, $mediaPosition, $normalizedPosition);
} catch (Exception $e) {
echo 'Exception when calling CoreApi->seek: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::CoreApi;
# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::CoreApi->new();
my $playerIndex = 56; # Integer | The player index starting from one
my $playbackName = playbackName_example; # String | The playback name `program` or `preview`
my $position = 0.0; # BigDecimal | The seek position in seconds from inpoint to endpoint.
my $mediaPosition = 0.0; # BigDecimal | The seek position in seconds from start of media.
my $normalizedPosition = 0.0; # BigDecimal | The normalized seek position between inpoint (0.0) and outpoint (1.0)
eval {
$api_instance->seek(playerIndex => $playerIndex, playbackName => $playbackName, position => $position, mediaPosition => $mediaPosition, normalizedPosition => $normalizedPosition);
};
if ($@) {
warn "Exception when calling CoreApi->seek: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint
# Create an instance of the API class
api_instance = openapi_client.CoreApi()
playerIndex = 56 # Integer | The player index starting from one (default to null)
playbackName = playbackName_example # String | The playback name `program` or `preview` (default to null)
position = 0.0 # BigDecimal | The seek position in seconds from inpoint to endpoint. (optional) (default to null)
mediaPosition = 0.0 # BigDecimal | The seek position in seconds from start of media. (optional) (default to null)
normalizedPosition = 0.0 # BigDecimal | The normalized seek position between inpoint (0.0) and outpoint (1.0) (optional) (default to null)
try:
# Seeks inside the current media
api_instance.seek(playerIndex, playbackName, position=position, mediaPosition=mediaPosition, normalizedPosition=normalizedPosition)
except ApiException as e:
print("Exception when calling CoreApi->seek: %s\n" % e)
extern crate CoreApi;
pub fn main() {
let playerIndex = 56; // Integer
let playbackName = playbackName_example; // String
let position = 0.0; // BigDecimal
let mediaPosition = 0.0; // BigDecimal
let normalizedPosition = 0.0; // BigDecimal
let mut context = CoreApi::Context::default();
let result = client.seek(playerIndex, playbackName, position, mediaPosition, normalizedPosition, &context).wait();
println!("{:?}", result);
}