fix: remove dead CalculateByteOffset C# shim; guard AudioPlayer.calculateByteOffset on parsed format
This commit is contained in:
@@ -128,18 +128,6 @@ public class AudioInteropService : IAsyncDisposable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<long> CalculateByteOffset(string playerId, double positionSeconds)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
return (long)await _jsRuntime.InvokeAsync<double>("DeepDrftAudio.calculateByteOffset", playerId, positionSeconds);
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<AudioOperationResult> ReinitializeFromOffset(string playerId, long totalStreamLength, double seekPosition)
|
public async Task<AudioOperationResult> ReinitializeFromOffset(string playerId, long totalStreamLength, double seekPosition)
|
||||||
{
|
{
|
||||||
return await InvokeJsAsync<AudioOperationResult>("DeepDrftAudio.reinitializeFromOffset", playerId, totalStreamLength, seekPosition);
|
return await InvokeJsAsync<AudioOperationResult>("DeepDrftAudio.reinitializeFromOffset", playerId, totalStreamLength, seekPosition);
|
||||||
|
|||||||
@@ -367,6 +367,7 @@ export class AudioPlayer {
|
|||||||
* Calculate byte offset for a time position (for C# layer)
|
* Calculate byte offset for a time position (for C# layer)
|
||||||
*/
|
*/
|
||||||
calculateByteOffset(positionSeconds: number): number {
|
calculateByteOffset(positionSeconds: number): number {
|
||||||
|
if (!this.streamDecoder.getFormatInfo()) return 0;
|
||||||
return this.streamDecoder.calculateByteOffset(positionSeconds);
|
return this.streamDecoder.calculateByteOffset(positionSeconds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user