Jump to content

Hyperlinks and Redirection in UniGUIServerModuleHTTPCommand?


mos

Recommended Posts

I have an application that allows a user to login and listen to recordings. The recordings themselves are stored in an encrypted format for content and security reasons. To play a recording, the user selects the recording from a grid, and then clicks on the button to play a recording. The web server will decrypt the selected recording into a file in users temporary cache, and that file is the referenced in the html 5 audio player.

I have posted a couple of messages about playing and seeking functions in audio files when a user run a Chrome brower. The range of options the program gives a user now includes

(option 1) uses flash player, which depending on who you believe is getting phased out and

(option 2) if option set, runs external program to play the recording using anchor tag. The principle here is similar to that of the "tel" protocol, except that we have own protocol handler which run the windows media player and passing reference to the decrypted recording as a URL.

In (option 2) the program has to decrypt on the fly, for this to work, a form is presented to the user with instructions and all the user has to do is click on the hyperlink 

<a href="our-protocol-handler:wmplayer.exe + link to temporary file">OfficeWebRun</a>

and playing starts (the protocol handles take the arguments received and determines the actions to take). Of course, the above is not needed on other web browsers, as they can also use html 5 audio controls and seek within a file. This is all needed just for users with Chrome. Today I have been asked...

"Can we run the program directly without needing to display the the player message and users needing to click the additional link?"

Given the steps that occur between the selecting the file and the actual playing, I was wondering of it were possible to use the UniGUIServerModuleHTTPCommand or UniGUIServerModuleHTTPDocument, which... if they knew the request was to play a recording, the program would be able to decrypt file A into unencrypted file B and send B to back to the user instead of A. If this is possible, are there any unigui demo program that receives GET request for file A and user is sent audio file B instead?

My questions are:

1. Is what I describe in the last paragraph possible?

2. If so, which event handler to use? UniGUIServerModuleHTTPCommand or UniGUIServerModuleHTTPDocument?

3. How would the response be formatted so that file B is sent rather then the original file A requested.

Thanks
 

Link to comment
Share on other sites

Finally worked it out myself... I could use window.open() passing the value in href as the 1st parameter, and then sending the js code back to the browser...

 

    script_ :=
    'window.open(' + '''' +
    'protocol-handler:' + getFullUrl(audioUrl, '/') + '''' + ',' + '''' + '_self' + '''' + ')';
    uniSession.AddJS(script_);
 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...