Я получил ответ. SeekTo не работает при использовании с AVPlayerLooper.
AVPlayerLooper сам по себе имеет временной диапазон свойств. Пример приведен ниже
playerLooper = AVPlayerLooper(player: self.player!,
templateItem: item!,
timeRange: CMTimeRange(start: CMTime(seconds: Double(start), preferredTimescale: 1) , duration: CMTime(seconds: Double(duration), preferredTimescale: 1)))
Изменение кода к этому позволяет, чтобы объектный менеджер состояния отследил изменение и позволил, чтобы Шаблон был добавлен.
public static void AddTemplate(Template template)
{
using (TheEntities context = new TheEntities())
{
if (template.TemplateType.EntityKey != null)
{
TemplateType type = template.TemplateType;
template.TemplateType = null;
context.AttachTo("TemplateTypes", type);
template.TemplateType = type;
}
context.AddToTemplates(template);
context.SaveChanges();
context.RemoveTracking(template);
}
}