Is there any way to set filename for HTML video tag when we use src as YouTube video root URL - html5-video

<video controls disablePictureInPicture >
<source src="https://r6---sn-uvu-2tme.googlevideo.com/videoplayback?expire=1609575422&ei=ntfvX_r4HcviogPYlqTYBw&ip=101.109.42.23&id=o-ALlNEoFZeOAiuFl8YkarSQ8DoUfqHGQGSdFxLI5KIjff&itag=18&source=youtube&requiressl=yes&mh=L5&mm=31%2C29&mn=sn-uvu-2tme%2Csn-uvu-c336&ms=au%2Crdu&mv=m&mvi=6&pcm2cms=yes&pl=23&initcwndbps=1058750&vprv=1&mime=video%2Fmp4&ns=0MPOtkwigfUSWUc9PykxRQgF&gir=yes&clen=4357379&ratebypass=yes&dur=68.382&lmt=1591493044603059&mt=1609553559&fvip=6&c=WEB&txp=5531432&n=s2-RHY1hBoqUa-TY&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cns%2Cgir%2Cclen%2Cratebypass%2Cdur%2Clmt&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpcm2cms%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRQIhANbetE7ckou73sKIRLOdgepN7jrLmyBurwYqQ74kpAW1AiAsAtA9T3a6BgcQT3VcIXc_wtFjo85idgDXx7ks_yd72w%3D%3D&sig=AOq0QJ8wRQIgNhjUQLelWr9fwe0RaAY-EQIaNL-2vdKvztaPGlkohl0CIQC4spm2S00zPQ3x8gf7AUOb6JVMkUVKaU3ef041TxwD1Q%3D%3D" type="video/mp4">
</video>
When I click on Download button its going to download the video with videoplayback.mp4 filename,
But I want myfileName.mp4 filename.
Is there any way to do this ?

As seen in this Stack Overflow question, if you create the download button yourself, you can set it like this:
Download
But it only works if you have the video on the same domain as the page with the download link on it (As detailed here).
If the video is not on the same domain or you want a different name when right-clicking and choosing "Save as", you need to set the Content-Disposition header on videoplayback.mp4 server side, like this:
Content-Disposition: attachment; filename="myfileName.mp4"
(I don't know your server software, so can't give a more specific example)

Related

how I can get full URL of images when using getPageHTML of dokuwiki xmlrpc api

I want to embed the HTML content of a dokuWiki page inside another web application. The content should be shown as a tooltip popup. But when I use the 'wiki.getPageHTML' api method to get the content, embedded images dont have the full path in their tag.
Like: <img src="/mywiki/lib/exe/fetch.....">
Is it possible to get the full image path in HTML code?
E.g.: <img src="https://testwiki.com/mywiki/lib/exe/fetch....">
This option do the job: https://www.dokuwiki.org/config:canonical
thx for andi who answered my question here.

generating streaming link api

i want to know how to use google api, can anyone give some example using php.
eg. use api to get picasa album rss.
Any help is appreciated!
For that you have to embed the video in your html with an iframe and a url like this:
<iframe src="https://drive.google.com/file/d/{videoID}/preview" width="640" height="480"></iframe>
Just change the {videoID} for the id of you video.
To get that code from Google, you should follow the next steps:
Open the video in your Drive.
In the top right of the view, you will see an icon that says "Pop-out", Click on it.
It will open the video in a new tab.
In the new tab click on the icon of the three dots that says "More actions" (in the top-center).
Select the option that says "Embed item...". You will see a popup with html code.
In general, there is no way to "predict" or "construct" a direct link to your Drive file. The supported method of getting the link is to use the Drive API. If you make an HTTP request to the file metadata endpoint https://www.googleapis.com/drive/v2/files/{fileId} with a valid API key, the webContentLink value should be the googleusercontent.com URL for your file.
You can try this out on the Google API Explorer - drive.files.get to see all of the information which is available through the Drive API.

Is there a download function in jsFiddle?

Is there a download function in jsFiddle, so you can download an HTML with the CSS, HTML and JS in one file, so you can run it without jsFiddle for debug purposes?
Ok I found out:
You have to put /show a after the URL you're working on:
http://jsfiddle.net/<your_fiddle_id>/show/
It is the site that shows the results.
And then when you save it as a file. It is all in one HTML-file.
For example:
http://jsfiddle.net/Ua8Cv/show/
for the site http://jsfiddle.net/Ua8Cv
New answer to an old question:
Method 1:
Step 1: You have to put /show after the URL you are working on:
http://jsfiddle.net/<fiddle_id>/show/
It shows the output with a result header.
Step 2: Right click the bottom frame and select View Frame Source. That's it. You got the html code with online JS links, CSS.
Just Save it.
For Example:
http://jsfiddle.net/YRafQ/20/show/
for the site http://jsfiddle.net/YRafQ/20/
Note: View Frame Source and not View Page Source
Method 2:
You can use this code: view-source:http://fiddle.jshell.net/<fiddle_id>/show/light/
For Example: For my fiddle_id: YRafQ/20
view-source:http://fiddle.jshell.net/YRafQ/20/show/light/
Step 1:
Go to a fiddle page like jsfiddle.net/oskar/v5893p61
Step 2:
Add '/show' at the end of the URL, like jsfiddle.net/oskar/v5893p61/show
Step 3:
Right click on the page and click on the View frame source. You will get the HTML code including CSS in tag and Javascript (js) in tag. [Also source link of all library will be added].
See screenshot
Step 4:
Now you can save the source code in a .html file.
Adding /show does not present a pure source code, it's an embedded working example. To display it without any additional scripts, css and html, use:
http://fiddle.jshell.net/<fiddle id>/show/light/
An example:
http://fiddle.jshell.net/Ua8Cv/show/light/
No, JSFiddle doesn't have a download feature. However, it's not very difficult to get around that and save the contents of a fiddle anyway.
Since the time the accepted answer was posted, JSFiddle has made some recent UI and backend changes that affect the way a fiddle should be downloaded. Note the updated procedures below.
Simple Commandline Method
This method only downloads the fiddle's HTML, JavaScript, and CSS as a single file. The fiddle's external resources are not saved.
In the commandline shown below, fiddle_id refers to the ID number of the fiddle. For a fiddle with the URL "http://jsfiddle.net/<fiddle_user>/<fiddle_id>" or "http://jsfiddle.net/<fiddle_id>", only the fiddle_id is needed. The fiddle_user is unimportant.
At a shell prompt, enter the single commandline:
fiddleId=fiddle_id; curl "http://fiddle.jshell.net/${fiddleId}/show/" -H "Referer: http://fiddle.jshell.net/${fiddleId}/" --output "${fiddleId}.html"
The fiddle will be saved to a file named "fiddle_id.html".
Longer Browser Method
This method downloads the fiddle as well as its external resources. The steps given are based on using Google Chrome. Using other web browsers should work as well, but they may use different filenames.
Select the "Share/Embed" menu/link at the top of the JSFiddle edit page. In the dialog box that appears, copy the URL shown in the "Share full screen result" field. It will be of the form "http://jsfiddle.net/<fiddle_user>/<fiddle_id>/embedded/result/" or "http://jsfiddle.net/<fiddle_id>/embedded/result/".
Open a new browser window and paste in the URL copied in the previous step. Load that page.
Use your browser's save feature to save the page and all of its resources to your local computer. To save all the resources using Google Chrome, for example, be sure to select "Webpage, Complete" in the "Format" menu. Be sure to specify a name for the page. Let's say it's named "fiddle.html" for this example.
After the page is saved to your computer, you will have the "fiddle.html" file and a directory named "fiddle_files". The file "fiddle.html" is the wrapper page that JSFiddle uses to display a header with a "Result" title and other links. It will load your fiddle in an iframe element. For the most part, this file can be ignored or even deleted. Your fiddle's HTML, JavaScript, and CSS content will all be saved in the "fiddle_files" directory as a single file named "saved_resource.html".
Copy "fiddle_files/saved_resource.html" to wherever you'd like to use it. If your fiddle included items under "External Resources", those will also appear in the "fiddle_files" directory. Be sure to copy those files to the same place to which you copied "saved_resource.html", because the HTML file will refer to those resources using relative URLs.
As mentioned earlier, other browsers may name the files differently when they are saved. For example, Firefox names the combined HTML/JS/CSS file "fiddle_files/a.html".
Still no download functionality supported.. BUT.. you can use the jsfiddle-downloader node script.
Installation:
npm install jsfiddle-downloader -g
To download a single fiddle from its id:
jsfiddle-downloader -i <fiddle-id> [-o <output file>]
To download a single fiddle from its url:
jsfiddle-downloader -l <url> [-o <output file>]
jsfiddle-downloader -l jsfiddle.net/<user>/<fiddle-id>
jsfiddle-downloader -l https://jsfiddle.net/<fiddle-id>
jsfiddle-downloader -l https://jsfiddle.net/<user>/<fiddle-id>/show/ -o myfiddle.html
To download all scripts of a determinated 'user' from jsFiddle.net:
jsfiddle-downloader -u <user> [-o <output file>]
It'll download all backups in the currrent directory, the jsFiddles scripts will be named as:
[<output-folder>/]<id-fiddle>.html
The best way is:
Right-click on the output panel.
Choose view frame source, then the whole code will appear.
After that you can copy that code, and paste it in your computer.
You have to put /show a after the URL you're working on:
For example:
"http://jsfiddle.net/rkw79/PagTJ/show/"
for Field URL :
"http://jsfiddle.net/rkw79/PagTJ/"
after that save the file and go to the show folder(or the file name you have saved with) under that folder u will get a html file show_resource.HTML .that is your actual file.now open it in browser and view the source code. Best of luck--------Ujjwal Gupta
In a recent work I had to download a list of fiddle urls and create separate folder for each fiddles having separate html css js file for each, i have created the following crawler program for this.
https://github.com/sguha-work/FiddleCrawler
.It will create folder name with counter value and each folder will have a html, a css, a js and a details file. (The details file will holds the links of external resources).
I found an article under the above topic.There by I could take the full code .I will mention it.
Here are steps mentioned in the article:
Add embedded/result/ at the end of the JSFiddle URL you wanna grab.
Show the frame or the frame’s source code: right-click anywhere in the page and view the frame in a new tab or the source right-away
(requires Firefox).
Finally, save the page in your preferred format (MHT, HTML, TXT, etc.) and voilà!
also you can find it : https://sirusdark.wordpress.com/2014/04/10/how-to-save-and-download-jsfiddle-code/
You can download using this package in node js,
https://www.npmjs.com/package/jsfiddle-downloader
There is not such a proper way to download all the things all together from JSFiddle but there is a hack way to do just that.
Simply add "embedded/" or "embedded/result/" at the end of your JSFiddle URL!, and then you can save the whole page as an HTML file + the external libraries (if you wants).
If you want to download all of your fiddles to an offline folder, there is a script available for this:
https://github.com/isonno/DownloadJSF
Try copying and pasting your code into WebDen and then downloading it from there. Only drawback is that it only supports pure JS, html, and css, so any other code may need to be downloaded another way.
Okay, the easiest way, I found out was just changing the url (jsfiddle[dot]net) to fiddle[dot]jshell[dot]net/
There u have a clear html code, without any kind of iframe...
Example:
https://jsfiddle[dot]net/mfvmoy64/27/show/light/ -> http://fiddle[dot]jshell[dot]net/mfvmoy64/27/show/light/
(Must change the '.''s to "[dot]" because of stackeroverflow... :c)
PS: sry 4 bad english
There is npm-package jsfiddle-downloader.
Use http://jsfiddle.net//show/light/
then just use inspect element function of browser. you will get code in iframe tab. . in chrome just right click and cick on edit as html tab. and copy the html content. that is your actual code.
Ctrl + S, saves the entire fiddle, inside the files folder there is the clean page you are looking for

How do you remove links from UIWebView?

I'm using UIWebView on my iPhone application. How do I remove the links that ios put by it self. For example I have some double value and ios think it's a phone number and highlighting it!
I try to disable the user interaction from the xib file. Didn't help. Can someone help me.
In the <head> of the html, you can put:
<meta name="format-detection" content="telephone=no">
Safari HTML Reference:
By default, Safari on iOS detects any string formatted like a phone
number and makes it a link that calls the number. Specifying
telephone=no disables this feature.
Or to unset this detection from a web view programatically using the dataDetectorTypes mask:
webView.dataDetectorTypes &= ~UIDataDetectorTypePhoneNumber;
Have you tried to change the dataDetectorTypes value ?
You can use this property to specify the types of data (phone numbers, http links, email address, and so on) that should be automatically converted to clickable URLs in the web view. When clicked, the web view opens the application responsible for handling the URL type and passes it the URL.
See more details here: http://developer.apple.com/library/ios/#documentation/uikit/reference/UIWebView_Class/Reference/Reference.html#//apple_ref/occ/instp/UIWebView/dataDetectorTypes

How Do I Open A PDF In Sitecore

How do I open a pdf document stored in Sitecore when a user clicks a link? The pdf document is stored in the Media Library.
Here's the code I have now:
Sitecore.Data.Fields.LinkField linkField = item.Fields["Url"];
tab.NavigateUrl = linkField.Url;
Same rules apply to a PDF media as to any other type in media library. If you need just to retrieve the media url to construct a link, do the following:
MediaItem mediaItem = linkField.TargetItem;
if(mediaItem != null)
MediaManager.GetMediaUrl(mediaItem);
You can also simply use web control or xsl control to render the link:
Web control:
<sc:Link Field="Url" Item="if you need to process specific item" runat="server" />
If your question concerns browser behavior when the link is clicked, set ForceDownload to true:
<mediaType name="PDF file" extensions="pdf">
<mimeType>application/pdf</mimeType>
**<forceDownload>true</forceDownload>**
<sharedTemplate>system/media/unversioned/pdf</sharedTemplate>
<versionedTemplate>system/media/versioned/pdf</versionedTemplate>
</mediaType>
Be aware of problems with Firefox on a Mac, as PDFs wont seem to work there.
For that you need to setup some stuff according to this.
if you can't access that is basically tells you to go to the web.config, find this:
<mediaType name="PDF file" extensions="pdf">
and change the
<forceDownload>false</forceDownload>
to
<forceDownload>true</forceDownload>