55143681 Posted October 16, 2021 Share Posted October 16, 2021 Questions: 1.I know in the mobile ,UnimVideo can play videos, but,How can I play videos in desktop? 2.UnimVideo can not play *.flv files,how to do that? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted October 16, 2021 Share Posted October 16, 2021 Hello, There are solutions on the forum, have you tried searching? Quote Link to comment Share on other sites More sharing options...
irigsoft Posted October 16, 2021 Share Posted October 16, 2021 2 hours ago, 55143681 said: Questions: 1.I know in the mobile ,UnimVideo can play videos, but,How can I play videos in desktop? 2.UnimVideo can not play *.flv files,how to do that? Hello, when I need to show vdeo this what I use: TUniForm_VideoFrame = class(TUniForm) with frame UniHTMLFrame1: TUniHTMLFrame; on BtnClick var MyStrList : TStringList; with TUniForm_VideoFrame.Create (UniApplication) do begin //ClientEvents.ExtEvents.Values['form.resize'] := 'function form.resize(sender, width, height, oldWidth, oldHeight, eOpts);' // + '{' // + ' var Velement = document.getElementById("MyVideoFrame");' // + ' Velement.width = ' + IntToStr (uniForm_VideoFrame.width) + ';' // + ' Velement.height = ' + IntToStr (uniForm_VideoFrame.height) + ';' // + '};' // ; //set width if TRIM (MyStrList [1]) = '' then MyStrList [1] := IntToStr(UniHTMLFrame1.Width); //set Height if TRIM (MyStrList [2]) = '' then MyStrList [2] := IntToStr(UniHTMLFrame1.Height); //set defaults if TRIM (MyStrList [3]) = '' then MyStrList [3] := 'autoplay muted controls controlsList="nodownload"';//'autoplay muted loop controls controlsList="nodownload"' //set file type sVideoFileType := COPY (ExtractFileExt (PlaySoundFile),2,Length (ExtractFileExt (PlaySoundFile))); sVideoFileType := StringReplace (sVideoFileType,'ogv','ogg',[rfReplaceAll,rfIgnoreCase]); //sVideoFileType := StringReplace (sVideoFileType,'ogv','WebM',[rfReplaceAll,rfIgnoreCase]); sVideoFileType := LowerCase(sVideoFileType); UniHTMLFrame1.HTML.Add(' <!DOCTYPE html> ' + ' <html> ' + ' <body> ' + ' <video id="MyVideoFrame" ' + ' width="' + MyStrList [1] + '"' + ' height="' + MyStrList [2] + '"' //add params + MyStrlist [3] + ' >' + ' <source src="' + PlaySoundFile +'"' + ' type="video/' + sVideoFileType + '"> ' + ' Your browser does not support the video tag.' + ' </video> ' + ' </body> ' + ' </html>); ShowModal; end; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.