RenderHeads / UnityPlugin-AVProVideo

AVPro Video is a multi-platform Unity plugin for advanced video playback
https://www.renderheads.com/products/avpro-video/
224 stars 27 forks source link

[Android] Playing Video From Offset Doesn't Work #1881

Closed HZekriDEV closed 1 week ago

HZekriDEV commented 3 weeks ago

Description When trying to use the "mediaPlayer.PlatformOptionsAndroid.fileOffset" functionality, the player simply plays from the beginning of the video rather than from the offset. This happens despite replicating the instructions given in this page:

https://www.renderheads.com/content/docs/AVProVideo/articles/feature-content-protection-core.html

Setup

Chris-RH commented 3 weeks ago

Hi,

Have you put your video within a dummy video and its playing the dummy video instead? Or are you expecting file offset to start your video at a later point?

HZekriDEV commented 3 weeks ago

Thanks for your response!

I'm using a dummy video that is appended at the beginning of the real video. When I play the video, the dummy video is the only thing that plays.

Chris-RH commented 3 weeks ago

Are you setting the offset by scripting or in the mediaplayer component?

HZekriDEV commented 3 weeks ago

I tried both ways.

HZekriDEV commented 3 weeks ago

Here is the code that I am using to play the video. It could be that I made a mistake in reading the instructions.

using UnityEngine; using RenderHeads.Media.AVProVideo; using System.IO;

public class Play360Video : MonoBehaviour { public MediaPlayer mediaPlayer; public string videoFileName = "Video.mp4"; private string videoPath;

void Start()
{
    if(Application.platform == RuntimePlatform.Android)
        videoPath = System.IO.Path.Combine(Application.persistentDataPath, videoFileName);
    else
        videoPath = System.IO.Path.Combine(Application.dataPath, videoFileName);

    //Setup
    MediaHints hints = mediaPlayer.FallbackMediaHints;
    hints.stereoPacking = StereoPacking.TopBottom;
    mediaPlayer.FallbackMediaHints = hints;

    //Offset
    mediaPlayer.PlatformOptionsAndroid.fileOffset = 319044;

    // Load the video
    mediaPlayer.OpenMedia(MediaPathType.AbsolutePathOrURL, videoPath, autoPlay: true);

}

}

Ste-RH commented 3 weeks ago

This should be fixed in v3.0.2 (penciled in for release by the end of the week)

Chris-RH commented 3 weeks ago

AVPro Video version 3.0.2 has been released. Please let us know if it has not fixed your issue.

Ste-RH commented 2 weeks ago

A new fix for this will be in the next release (v3.0.3).

Chris-RH commented 2 weeks ago

AVPro Video version 3.0.3 has been released. Please let us know if it has not fixed your issue.