Creating a Restart button on my website?

  • 1
  • Question
  • Updated 4 years ago
  • Answered
I would like to create a button on my website that restarts one of my displays.

I found information with a javascipt function called "restartDisplay()" on the core.display.restart page, but I need some help with implementing it on my web page. 

Anyone have any instructions on how to use the function on my website?

Thanks
Photo of Robert

Robert

  • 392 Points 250 badge 2x thumb

Posted 4 years ago

  • 1
Photo of Blake Freeman

Blake Freeman, Official Rep

  • 36,116 Points 20k badge 2x thumb
Robert,

Is your goal to build a website that contains a link to restart your display?
Photo of Robert

Robert

  • 392 Points 250 badge 2x thumb
Yes, I just want to have someone be able to only restart a display by using a button...similar to the restart button on the rise vision displays page
Photo of Blake Freeman

Blake Freeman, Official Rep

  • 36,116 Points 20k badge 2x thumb
Robert,

All of our documentation regarding the restart player feature can be found here. I'm not sure of your level of experience with development, but this article is intended for developers. Using the restart displays command will require a call to our API.
Photo of Robert

Robert

  • 392 Points 250 badge 2x thumb
where can i find information on how to make the call to the api?
Photo of Blake Freeman

Blake Freeman, Official Rep

  • 36,116 Points 20k badge 2x thumb
All of the documentation regarding custom development is located at http://help.risevision.com/#/developer.
Photo of Robert

Robert

  • 392 Points 250 badge 2x thumb
I created a project, got a client id, registered an app.... now I don't know how that info works with this..............

function getDisplay() {
    console.log('getDisplay');
    // getting parameter values
    var _id = document.getElementById('getDisplay_id').value;
    var _fields = document.getElementById('getDisplay_fields').value;

    // create a javascript object which will be converted to Json
    var parameters = {};
    if (_id) {
        parameters['id'] = _id;
    }
    if (_fields) {
        parameters['fields'] = _fields;
    }

    // loading and calling the api passing the parameter object
    gapi.client.load(API_NAME, API_VER, function () {
        var request = gapi.client.core.display.get(parameters);

        request.execute(function (jsonResp, rawResp) {
            handlesResponse(jsonResp, rawResp, 'getDisplayResult');
        });
    }, ROOT);
}

Photo of Robert

Robert

  • 392 Points 250 badge 2x thumb
Where can I find a step by step tutorial on how to make a call to the API to restart a display?  I'm sure this is a simple thing.
Photo of Blake Freeman

Blake Freeman, Official Rep

  • 36,116 Points 20k badge 2x thumb
Robert,

We do not have step by step tutorials for developers. I will check in with a developer to see if they can answer this question for you.
Photo of Blake Freeman

Blake Freeman, Official Rep

  • 36,116 Points 20k badge 2x thumb
Robert,

I have been advised to have you check out our api explorer. You can send commands from this explorer to see how they work.
Photo of Robert

Robert

  • 392 Points 250 badge 2x thumb
I can use the  core.display.restart in the api explorer. by entering my display ID. It does work. But how do I implement that as a button on my own website?
Photo of Robert

Robert

  • 392 Points 250 badge 2x thumb
I can use the  core.display.restart in the api explorer. by entering my display ID. It does work. But how do I implement that as a button on my own website? 
Photo of Blake Freeman

Blake Freeman, Official Rep

  • 36,116 Points 20k badge 2x thumb
Robert,

Do you simply want a button that refreshes the presentation on the screen? Or do you want something that actually restarts the player, or reboots the media player?
Photo of Mat Meiers

Mat Meiers

  • 82 Points 75 badge 2x thumb
If you are just wanting to reload the html on the page you can add a button with this method attached. <a id="reset" href="javascript:history.go(0)" class="btn">reset</a>
(Edited)
Photo of Robert

Robert

  • 392 Points 250 badge 2x thumb
Im looking to just have a restart button on a webpage. so I can restart a display from any web browser. I would think this would be easy as just adding some javascript to my web page. I need to know what that code would be. Then once I understand that then I can implement other api calls....thanks
Photo of Robert

Robert

  • 392 Points 250 badge 2x thumb
Im looking to just have a restart button on a webpage. so I can restart a display from any web browser. I would think this would be easy as just adding some javascript to my web page. I need to know what that code would be. Then once I understand that then I can implement other api calls....thanks
Photo of Blake Freeman

Blake Freeman, Official Rep

  • 36,116 Points 20k badge 2x thumb
Robert,

You will need to create a link or button on your website to point to https://rvaserver2.appspot.com/_ah/api/core/v1/display/restart?id="displayID". The caveat to this is authentication. The browser that accesses this website must be logged into a gmail account associated with your company in Rise Vision, and it must be assigned a Display Administrator role.
Photo of Robert

Robert

  • 392 Points 250 badge 2x thumb
ok thanks...i think that'll work.

but is there a way to have the users of my website log into their google account from my page with the restart button?

thanks
Photo of Blake Freeman

Blake Freeman, Official Rep

  • 36,116 Points 20k badge 2x thumb
Robert,

If users of your website log in, they will still need to be recognized as display administrators in your Rise Vision account. As far as allowing users to log into their accounts from your websites, that's something you'll have to ask google support/development about.
Photo of Robert

Robert

  • 392 Points 250 badge 2x thumb
ok.

what other things can be done, using a url like the one you sent for the restart, to control the signage
Photo of Blake Freeman

Blake Freeman, Official Rep

  • 36,116 Points 20k badge 2x thumb
Robert,

To my knowledge only reboot player and restart computer exist, however you can do some research at our api explorer list to find more features.