there is a website on wordpress, i load it through TChromium in project Delphi.how to make loading files: css, js, images locally? if the files lie near to exe.
and another question is why TChromium not playing video?
on youtube works, the with video direct link not load(
You can load local files by loading a FILE URL. In case of DCEF3 you would call TChromium.Load and in case of CEF4Delphi or OldCEF4Delphi you would call TChromium.LoadURL.
The FILE URL would look like this :
file:///c:/path/file.html
Read these pages to know more about FILE URLs :
https://www.rfc-editor.org/rfc/rfc8089
https://en.wikipedia.org/wiki/File_URI_scheme
The HTML and CSS files would have to use relative paths to the other resources or the browser will not find them.
Chromium has some security limitations for local files. If you find any issue loading your files with a FILE URL then you could try to load them with a custom URL scheme. CEF4Delphi has a demo called SchemeRegistrationBrowser that shows you how to register a custom scheme.
About the issue with the videos, it's a codec problem. The CEF3 binaries available at Spotify only have the open source codecs enabled due to patent restrictions.
If you need to watch H264 videos then you need to build the CEF3 binaries following these instructions :
http://magpcss.org/ceforum/viewtopic.php?f=6&t=13515
Edit : I forgot that some video players require Flash. Install the PPAPI Adobe Flash Player from here : https://get.adobe.com/flashplayer/otherversions/
CEF4Delphi enables the flash player by default but you might need to use the --enable-system-flash command switch with DCEF3.
Related
I am going to build an educational site where users will not have access to the original video file and will only be able to watch it through the site. Is there a way that the file is not recognized by the IDM plugin?
According to the articles I read on the Internet, blob can be used, but there was no solution for local use of Azure Storage blob.
In terms of preventing downloads via browser plugins like IDM, you can use
streaming to send the video content in small chunks rather than as a single file. This can make it hard for plugins to intercept and download the entire file. Azure Blob Storage supports "pseudo streaming" of video content via the "Range" header in HTTP requests. This can be useful - https://stackoverflow.com/a/15166547/13105803
Or another option is to use Azure media service
I've been working on a game in javascript for my CS course. When I open the document by hitting run in Webstorm, it loads the game correctly, however when I just try opening the html file from Finder, the webpage opens but none of the png files I'm using for the sprites load. I opened Inspect Element in google chrome, and the javascript files loaded correctly but all the png files listed as canceled. This doesnt happen when the game is run from webstorm (when I run it from webstorm, all image files load properly).
When the game is opened directly from an html file (that's when I have the problem), chrome lists the path of the html document as the webaddress, although when opened from webstorm, it lists http://localhost:63342/CS%20Week%2010/CS105_Jessica.Davis_DogGame.html?_ijt=tmrr2fndgac82h07hlvt101gi4
How can I get around this issue so that when opening the html file from Finder it loads everything correctly? All image files are in the same directory as the html file.
Because of browsers security, loading files like this might not work from a url starting with file://
What webstorm is probably is making a local web server so that instead of saying file:// you could say http://. if any website was able to load images from file:// then any webpage you visit would have been able to search for any file on your computer and send it over the internet without your consent so browser often have these settings on. So you'd need a server. If you are working on your computer, you could make a local server just like webstorm and host your own files there. or host it on another service like github pages or codepen.
Now since all images are in the same directory, make sure that every time you call loadImage you use the images name and extension instead of saying /User/user/whatever_other_directory_you_have_it_under/image.png.
Once you did that you can make a local web server for the project. To make a local server, open Terminal (an application under utilities, you could spotlight search for it as well) and type cd, drag your project folder and drop it over terminal, and hit enter. Then type python -m SimpleHTTPServer and wait till it says something like Serving HTTP on 0.0.0.0 port 8000 .... Then taking the 0.0.0.0 and the 8000 you see in the example (yours may or may not be the same) go to your browser and type http://0.0.0.0:8000 (replacing the digits with whatever you got, not this link doesn't work until you do that)
Images should load alright. If you need to stop the server you can go back to terminal and hit control+C.
Note that when presenting your p5 sketch, no one else would be able to see the website on their computers if you make your local server. The local server is secluded to the device that is running it (although if their making their own local server and have your project files it should work just fine).
If you want the website hosted so that you could share a link with anybody in the world you could use codepen or github pages. If you go to codepen.io it should be self-explanatory although you'd have to upload your images to some image hosting site like tumblr or something and add the URL source of those images to codepen or you could put everything into github for even better results!
To use github pages you'd need to make a github account (preferably with your username being whatever you want your page to be named). Make a repository named insert_username_here.github.io. add your files to the repository (make sure to try to keep all sub directories and folder exactly as they are from your project folder). After a minute or two go to http://insert_username_here.github.io to admire your brand new hosted webpage!
when you download a file from MEGA service, a web page to display a download progress bar will appear. After the bar reaches 100%, your browser will notify users to save the file into a selected folder. I know that Mega use HTML5 FileSystem API to do this (Download files like mega.co.nz ). However, i don't know when the file is completely downloaded into the sandboxed directory, how the browser's instructed to notify users about the download? Would you please answer my question? Thanks in advance.
By using either a[download], msSaveOrOpenBlob, or Adobe Flash SWF Filewriter, depending on which method is supported by the browser.
PS: MEGA doesn't always use HTML5 FileSystem API. They have various techniques that they use depending on the browser support. In Firefox 20+, for example, they will store the data temporarily to the IndexedDB storage, before triggering the a[download].
I'm developing an Adobe AIR javascript application which loads an .swf file exported from InDesign (interactive book). That .swf has a "MySWF_Resources" directory with a sample .flv video.
The problem is, when I load that .swf into my AIR application using SWFobject it loses the ability to load its assets - somehow the paths are incorrect when run inside AIR environment. The same .swf file executed in a browser properly loads the video from "MySWF_Resources" directory.
Is it possible to somehow force the working directory in which .swf should look for the files? AIR breaks somehow relative paths for included .swfs.
Below is how you would include FLV / movie files via SWF in an air application. You need to use the absolute path of the FLV file since Flash does not know the Air app:/ structure. You can do the following:
Include AIRAliases.js (located in air sdk package)
Include jPlayer (LINK)
Add air event listener for invocation (LINK)
Save the current directory to a variable/object in javascript
Reverse slashes of location ( myVar.replace(/\\/g,"/") )
Pass in the location + file.flv to jPlayer object
Using jPlayer saves a number of steps, but if you would like to do it via standard SWF you need to create the embed/object via javascript and pass in a flashvars for the location of the FLV file. You then have the flashvars set the content source in the SWF via ActionScript (LINK).
www.mark??z.se/test
Remove the: ??
It is only 4 files:
index.html
appIcon.png
startup.PNG
SMS_2.jpg
How can i make this to an offline app, is it possible?
The CSS and all JS are in the html file.
Read about creating offline web apps here:
http://diveintohtml5.ep.io/offline.html
The iPhone Safari browser supports offline web apps. You need to:
modify the webpage to reference a cache.manifest file
create a cache.manifest file listing the resources that need to be downloaded
configure your web server to serve the cache.manifest file with the proper content type
I used this reference (among others) to create an offline GWT web app. iPhone/Safari can "bookmark" the website by using "Add to Home Screen" so it looks like an iphone native app.
Good luck.
The UIWebView
http://developer.apple.com/library/ios/#documentation/uikit/reference/UIWebView_Class/Reference/Reference.html
is capable of displaying html content that has javascript and css associated with it. I should be possible to include your files as part of the app's bundle and have the UIWebView load them. Have a read through that class reference and sample code to see if it suits your needs.
in a desktop pc, be shure every resource is boundled with the html file, css inlines, js inlines, images encoded in css via url('data:image')
#see http://en.wikipedia.org/wiki/Data_URI_scheme
and associate a browser to html files, doubleclick on the page will open your page.
also chrome has a "create application shortcut" that will make an even more "native" frame around your html5 app.
prism https://wiki.mozilla.org/Prism is the same concept implemented with mozilla engine.
in mobile browsers based on webkit there are similar means to exploit, i.e. for iPad you can create shortcuts in the home screen that will look exactly like a native application and access a 5Mb of file cache(http://www.html5rocks.com/tutorials/appcache/beginner/).