playMaker

Author Topic: Unity Web Player  (Read 6101 times)

qholmes

  • 1.2 Beta
  • Hero Member
  • *
  • Posts: 509
Unity Web Player
« on: September 02, 2011, 04:47:41 PM »
I am trying to get a Web Player working inside of Power Point.. it works but i have right click in my project and when you right click in the Web Player it brings up the Options Menu for Java or something.. its in the other room.

Does anyone know a way around this besides changing my right click?

Q

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: Unity Web Player
« Reply #1 on: September 02, 2011, 05:02:48 PM »
You can disable the Unity right click menu:

Code: [Select]
var params = {
disableContextMenu: true
};
unityObject.embedUnity("unityPlayer", "WebPlayer.unity3d", 960, 450, params);

Not sure if Power Point has its own right click menu though...

qholmes

  • 1.2 Beta
  • Hero Member
  • *
  • Posts: 509
Re: Unity Web Player
« Reply #2 on: September 02, 2011, 05:20:25 PM »
That is cool... Power Point seems to work great actually... worked well the second try..

But i dont know where to put this code.. I tried it in the HTML file just inside of the Function GetUnity.. but it does not work.. just trying in browser not Power Point right now.

Q

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: Unity Web Player
« Reply #3 on: September 02, 2011, 05:28:35 PM »
It goes inside <head>:

Code: [Select]
<script type="text/javascript">
  <!--
  function GetUnity() {
if (typeof unityObject != "undefined") {
return unityObject.getObjectById("unityPlayer");
}
return null;
}
  if (typeof unityObject != "undefined") {
var params = {
disableContextMenu: true
};
unityObject.embedUnity("unityPlayer", "WebPlayer.unity3d", 960, 450, params);
}
 
-->
</script>


You can also export a webplayer from Unity with the no context menu template selected and take a look at the code.

qholmes

  • 1.2 Beta
  • Hero Member
  • *
  • Posts: 509
Re: Unity Web Player
« Reply #4 on: September 02, 2011, 09:40:48 PM »
Ahhhhh i missed the ', params)' part in this line...

unityObject.embedUnity("unityPlayer", "WebPlayer.unity3d", 960, 450, params);

That makes the difference.

Thanks again.

And if anyone wants to put a Unity Project into a Power Point it is super easy using LiveWeb free plug in for Power Point.... I have a customer who does their presentations in Power Point and i am going to try and move them from rendered movies to live Unity movie apps instead... but they said it would have to run inside Power Point as all their presentation materials are already in there...

So there you go


Q

Damian

  • 1.2 Beta
  • Full Member
  • *
  • Posts: 188
    • Permaximum Betty
Re: Unity Web Player
« Reply #5 on: September 02, 2011, 10:33:39 PM »
Sounds great. Can be very useful..

qholmes

  • 1.2 Beta
  • Hero Member
  • *
  • Posts: 509
Re: Unity Web Player
« Reply #6 on: September 02, 2011, 11:22:53 PM »
Yes i was surprised that it worked so easily... so far anyway.. my projects are pretty simple controls wise.

Q

qholmes

  • 1.2 Beta
  • Hero Member
  • *
  • Posts: 509
Re: Unity Web Player
« Reply #7 on: September 06, 2011, 03:02:04 PM »
So i was able to get my player working quite well.. But i can not figure out how to remove all the boarder and margins in the player HTML file? I am not an HTML guy at all....

I managed to remove the top title and the bottom footer info but no matter what i change or adjust i can not get the player to have no space around it in the Web window.

Would also like to get rid of the scroll bar on the right side too..

I posted on the Unity Forum too but thought i would also post here. Will put any results here too.

Q

Kelevra88

  • Playmaker Newbie
  • *
  • Posts: 1
Re: Unity Web Player
« Reply #8 on: March 17, 2015, 10:32:32 AM »
Hello, how do you embed the player html file in power point? I have no idea how to do it and how you could get it work. Thanks