USharpVideo icon indicating copy to clipboard operation
USharpVideo copied to clipboard

How can I add initial text in InputField?

Open tyhbj opened this issue 1 year ago • 3 comments

I already knew how to set default video in Usharp video.But I need to preset some text in the input box,cause I need to have the video cloud resolution prefix to play bilibili videos in VRC. For example,when i play a bilibili video such as"https://www.bilibili.com/video/BV1btHZexEXw",i should add "https://biliplayer.91vrchat.com/player/?url=", combine into "https://biliplayer.91vrchat.com/player/?url=https://www.bilibili.com/video/BV1btHZexEXw" I want just paste only one url to change video in my world,help me please .

tyhbj avatar Dec 30 '24 10:12 tyhbj

Udon is not allowed to modify user's URL input for security reasons.

jacklul avatar Dec 30 '24 15:12 jacklul

Udon is not allowed to modify user's URL input for security reasons.

Thank you for your answer. As far as I know, the input of this world is preset with text."https://vrchat.com/home/world/wrld_29e92dbd-b1fa-479a-a53d-1f312cb54570/info", I don't know if it depends on udon.

tyhbj avatar Jan 01 '25 04:01 tyhbj

You can set field's default value in Unity but that's it, the user might delete the whole contents instead of pasting after it. You can also use Udon to reset the field to that value after each URL load (OnUSharpVideoLoadStart callback).

jacklul avatar Jan 01 '25 09:01 jacklul