Jump to content

mos

uniGUI Subscriber
  • Posts

    269
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by mos

  1. What seem to work? If you have a large audio file and downloading/playing over the Internet, seeking does not work. All it does is go back to beginning and starts over. So, for Chrome we switched to a flash control. (And got complaints from customer(s) that use Google Chrome. Now... for Chrome trying the <embed> option, but that does not seem to work as expected. And that led to the initial post above.
  2. Yes, but in Chrome you cannot seek within an audio file. Some customers don't like the idea of using flash (.swf) players and so attempting to embed a player with the above code which can seek in Chrome browser.
  3. The following code when run under IIS displays a little audio player in the web browser window <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Example of Inserting Audio Using embed Element</title> </head> <body> <embed src="/files/testfile1.mp3" width="200px" height="50px"> </body> </html> the same page when accessed via a unigui app does not show the audio player but the file is downloaded by the web browser. In the case of Google Chrome the file downloaded will then likely be played in an external player. Also note that I tried just using code <embed src="/files/testfile1.mp3" width="200px" height="50px"> in a html frame but the result was the same. Actually, I tried above first before testing in a separate web page by itself to see if the problem was in my code. In using the html code at the top of this email, I access the unigui version with http://127.0.0.1:8077/files/chrome-test.html and the IIS as http://127.0.0.1/files/chrome-test.html I am unsure of the problem but there would appear to be a delivery issue of an audio file from a unigui app. The reason why we are looking at "embed"ding code is to get over issues in Chrome browser and try to stay away from flash components. If anyone has idea on how to embed the player as shown here https://www.tutorialrepublic.com/codelab.php?topic=html5&file=insert-audio-using-embed-element can you please tell me what I am doing wrong? Thanks
  4. Hi Delphi Developer, Another question how can I actually call the FewLines.js code when the OnAjaxEvent is trigged for the label. ie. When I drag from a TUniTreeNode to the label the OnAjaxEvent triggers for the drag drop and I change the label text. When the label text changes I want to call the FewLines.js so it can ellipsis the label text if required.
  5. Thanks Delphi Developer. I was missing the "files/" in front of the FewLines.js and it now works.
  6. Attached is a test project that generates the error FewLines.zip
  7. Yes in the UniServerModule.CustomFiles I have fewlines.js
  8. Hi Delphi Developer, I tried this in a test app but got the attached error.
  9. Hi Delphi Developer, I found some third party JQuery code that I was trying to use at this site: https://www.jqueryscript.net/text/jQuery-Plugin-For-Responsive-Multi-Line-Text-Truncating-fewlines.html I have added the file fewlines.js to UniServerModule.CustomFiles. Question I have is if I want to apply this code to a TUniLabel where do I make call to fewlines and what should 'p' be ie. how do I pass the reference to TUniLabel? $('p').fewlines({lines : 4});
  10. Hi Delphi Developer, Just checking in to see if you have any ideas.
  11. Just bumping this to see if anyone ideas or has used any third party CSS/Javascript to handle this that they would recommend.
  12. If I want to update a TUniTreeView via a thread with data from a database. Would I need to use a TUniThreadTimer to retreive the data from the DB into some internal list and then have a TUniTimer process this list and update the treeview? I assume I can't just use a TUniTimer by itself to retrieve the data from the DB and update the treeview?
  13. Hi Delphi Developer, Thanks for the code. However I need to be able to ellipsis a label that actually wraps over multiple lines. e.g. This is a test line1 And this is test line... Do you know of a way that I can do this?
  14. Steps to follow 1. add TUniHTMLFrame to main form 2. add TUniButton to main form 3. add code to button on click event procedure TMainForm.UniButton1Click(Sender: TObject); var script_: string; begin script_ := '<audio id="player1" controls> ' + '<source src="files/testfile3.wav" type="audio/wav"></source>' + '</audio>'; UniHTMLFrame1.HTML.Text := script_; end; (Now, testfile3.wav is the 23Mb but within browsers like firefox I can set the currentTime via js) On Chrome, and without any such code (that does not work, ie. only using the above) trying to tell the player to start 1/2 way through the recording just goes back to the beginning! While the following link is related the video, it also applies to audio... https://stackoverflow.com/questions/27964533/js-currenttime-for-html-video-tag-is-not-working-on-chrome which includes reply The problem (at least regarding Chrome) is probably on the server side. Put Header set Accept-Ranges bytes in your .htaccess (this this answer) which points to this post... https://stackoverflow.com/questions/9563887/setting-html5-audio-position/9565178#9565178 and https://developer.mozilla.org/en-US/docs/Web/HTTP/Configuring_servers_for_Ogg_media#Handle_HTTP_1.1_byte_range_requests_correctly
  15. I need to be able to add trailing dots to a TUniLabel.Text if it doesn't have sufficient space to display the full label before it is clipped. e.g. If I have label text = '12345678901234567890' and label can only show ten characters than the label text should appear as '1234567...'
  16. Hi, Does unigui implement http 206 responses. We do not have the source code (.dcu files only) and when playing back audio to a user using html5 audio controls works on Firefox, Edge etc. If necessary I will have to use a flash player on Chrome browser just so that users can select the position to start playing recording from. On Chrome however, when you try to move the cursor towards the end on a audio file, the player restarts and goes back to the beginning. In the research that I have done, have posted the web server needs to implement range ranges and http 206 responses. Which brings me back to the original question.Based on a post on stackexchange I tried this in event handler UniGUIServerModuleHTTPCommand but does not seem to fire... (Is there a demo related to range requests and byte streaming?) filename := ARequestInfo.Document; if (Pos('/cache', filename) > 0) then begin StrReplace(filename, '/', '\', [rfReplaceAll, rfIgnoreCase]); filename := PathAppend(CacheFolderPath, filename); trace('TUniServerModule.UniGUIServerModuleHTTPCommand::filename=' + filename); stream := TFileStream.Create(filename, fmOpenRead or fmShareDenyNone); // THTTPServer parses the ranges for you if (ARequestInfo.Ranges.Count > 0) then begin if (ARequestInfo.Ranges.Count > 1) then begin AResponseInfo.ResponseNo := 416; Exit; end; range := ARequestInfo.Ranges[0]; rstream := TIdHTTPRangeStream.Create( stream, range.StartPos, range.EndPos, true); AResponseInfo.ResponseNo := rstream.ResponseCode; AResponseInfo.ContentRangeStart := rstream.RangeStart; AResponseInfo.ContentRangeEnd := rstream.RangeEnd; AResponseInfo.ContentStream := rstream; AResponseInfo.AcceptRanges := 'bytes'; end else begin AResponseInfo.ContentStream := stream; end; end; *)
  17. Hi Delphi Developer, Is there a way for me to test if the border color has been set or not set and then call a different Delphi procedure based on the color? e.g. when the border color is red call Delphi procedure 1 otherwise if not set then call Delphi procedure 2
  18. Hi Delphi Developer, Thanks for the above code. How can I test if the border color is set to red and then change it back to another color when the user clicks the Image again?
  19. Hi Delphi Developer, I have a TUniPanel which contains a TUniImage. When the user clicks on the TUniImage I want to change the border color and width to indicate that the image was selected. I then need to be able to call a Delphi procedure when the onClick occurs on the image as well.
  20. I need to be able to click on a TUniImage and when this occurs I want to change the TUniPanel border color and width to 5 that the image is contained in to clRed. I then need to be able to call some additional Delphi code to do some other processing.
  21. I have an application which has a toolbar with some toolbar buttons. I have enabled ShowCaptions on the ToolBar and the captions are appearing below the icon. However we are finding the the caption text on the right is being clipped when we run our application at different resolutions. Is there some way of preventing the text from being clipped?
  22. mos

    JPlayer Demo Program?

    Also... can unigui handle range requests as per... https://github.com/jalik/jalik-ufs/issues/92
  23. Hi, I am currently using html5 audio tags to play wave files via web browser. The problem is that Chrome does not seem to allow seeking into a file like Firefox and Edge. I have to look at alternatives and looking at jplayer as an alternative. Does someone have example code on embedding a jplayer into a UniHtmlFrame? (I am new to this stuff and any assistance would be greatly appreciated.) Thanks.
  24. Hi Delphi Developer, Tried it and it now works.
×
×
  • Create New...