Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Paste Text in WebPlayer

Discussion in 'UGUI & TextMesh Pro' started by Murrrly, Mar 12, 2015.

  1. Murrrly

    Murrrly

    Joined:
    Apr 25, 2013
    Posts:
    16
    I am creating an application that uses a lot of text and images, the user is able to paste in the URL to images and the WebPlayer will download it and display it on the screen.

    The download etc all works fine, the application in fact works 100% in the Unity editor and in standalone. But the final build is to be in the WebPlayer.

    In previous versions I never had a problem, but now I'm getting an error "System paste buffer is not accessible in WebPlayer" every time I try to paste. Is there any way around this?

    I have tried making a blank project with just a canvas and input field and running that as a WebPlayer build and I am able to paste into it, does anyone know what the limitation is or how I can overcome it?
     
  2. SimonDarksideJ

    SimonDarksideJ

    Joined:
    Jul 3, 2012
    Posts:
    1,685
    That doesn't sound like a Unity issue to be honest. Just tested here with the Web Platform build (not WebGL) and it worked fine.

    So more likely it is a security issue with the browser you are using. Most have some level of restriction options for accessing the paste buffer (both copy and paste).
    Try checking the settings on both your server and client. Did a few searches and tests and don't seem to have an issue with vanilla Chrome/IE or Firefox.

    Have you tried testing another browser to be sure?
     
  3. Murrrly

    Murrrly

    Joined:
    Apr 25, 2013
    Posts:
    16
    Thanks for the reply.

    I've noticed that other projects I've done, I don't have a problem with it. It's just this one project. I've not done anything different that I'm aware of.

    One thing I've noticed is that when the project is played locally it works fine, I'm wondering if it might be something to do with it being loaded over HTTPS.
     
  4. Murrrly

    Murrrly

    Joined:
    Apr 25, 2013
    Posts:
    16
    I've managed to fix it, although I can't say I understand the reason it worked.

    It turns out that if you block the user from going full screen in the webplayer, it also blocks access to the system paste buffer. Hope this helps anyone else who gets the same issue.
     
    SimonDarksideJ likes this.
  5. KevinCodes4Food

    KevinCodes4Food

    Joined:
    Dec 6, 2013
    Posts:
    61
    I have hit this issue if the webplayer app has not yet been clicked, or if the focus has changed to another webpage, etc.

    I put the paste call behind a button click event to make certain the user clicks the app first and gains focus.