vimeo-unity-sdk icon indicating copy to clipboard operation
vimeo-unity-sdk copied to clipboard

A way to change the Vimeo Player url on runtime to load another video in the same Player

Open NiteDev opened this issue 7 years ago • 4 comments

Describe the issue

I'm working on a project with REST calls to get the url on vimeo server, but I can't make the Vimeo Player load the url video and play it on Android using code. It 'd be great if you have a workaround or something that can help me.

Unity version

2018.3

NiteDev avatar Jan 02 '19 20:01 NiteDev

That should be possible. Can you share the code you wrote that isn't working for you? Is it not working on Android only or is it the Unity Editor too?

I haven't tested this, but this should work for you:

VimeoPlayer player = gameObject.GetComponent<VimeoPlayer>();
string new_video = "https://vimeo.com/1234";
player.LoadVideo(new_video);

caseypugh avatar Jan 02 '19 20:01 caseypugh

Yeah I did the same and it works on editor but when I compile on android it doesn't work .. That's why I'm confused with this, if I set the url on the Player inspector it works like a charm ... but can't make it work with code, so I think I'm missing something that is android relevant.

public IEnumerator ActivityProgressVideoLoad(string videoUrl)
    {
        yield return new WaitForEndOfFrame();

        vimeoPlayer.LoadVideo(videoUrl);
    }

Where videoURL is the REST response of the url

NiteDev avatar Jan 02 '19 21:01 NiteDev

Ah, ok. Android can have some strange issues that are problems with Unity (and not the Vimeo plugin). This might help you out.

You might want to consider using AVPro Video for playback on Android, which has better cross platform playback. It also supports adaptive video playback which is important for mobile.

caseypugh avatar Jan 02 '19 21:01 caseypugh

Can't make it work, I'm gonna try AVPro and tell later how it performs.

NiteDev avatar Jan 02 '19 21:01 NiteDev