how to disable video on command line when .testcafec.json has video options - command-line

I enabled video in .testcafec.json file.
But, sometimes I want to disable video on the command line.
For example,
testcafe .... --video-options enable=false,...

At present, you cannot disable video recording via command line. The TestCafe configuration file supports JSON5 syntax, so you can just comment out options related to video recording when it's necessary.
.testcaferc.json
{
//"videoPath": "videos"
}

Old question but maybe someone is still searching for a solution (like me).
As far as I know there is no enable/disable CLI flag yet but you can disable video by adding these two options:
testcafe ... --video "" --video-options ""
(the --video-options "" param is only required if you have declared videoOptions in your .testcaferc.json)

Related

Can I execute an executable file from a webview?

Is there a way to execute an executable file(.bat/.sh) from a webview? I have a button on a webview and would like to run the executable when that button is clicked. I looked into window.open(...) and ActiveXObject() but since a webview is not a browser window, they are irrelevant.
You could do this by contributing a Command which executes the script, and then creating a link that runs that command using a command URI in the WebView.
Let's call the command my.ext.runScript. Then we can add in our webview:
Run Script
Clicking that link will then invoke the script.
edit: Example
edit 2: You can also pass a message from the webview to your extension to invoke the command - documentation here.
Good luck!
I believe this is not possible. You don't have any browser or Node.js environment available in the web view. Also for security reasons the webview is pretty limited in what it can do, besides showing HTML content.
I was able to find a way. A webview communicates with your node env using the vscode api using the postMessage function. In the node env, you can spawn and handle a child process.
Docs:
VSCode postMessage
Node childProcess
Edit 1:
Example: VSCode Extension Tutorial
Let me know if you need further help. Thanks (:

change user agent in mplayer windows cmd?

I am viewing a video from rtsp://r5---sn- link and i wish to change the current user agent that shows up as
User-Agent: MPlayer (LIVE555 Streaming Media v2013.04.30)\r\n
in wireshark.
I also tried the command
mplayer -user-agent "QuickTime" rtsp://r5---sn-q4flrne6.googlevideo.com/Cj0LENy73wIaNAkbOZCZD61_VhMYESARFC3vKLxZMOCoAUIASARgxPz01cadit5ZigELM3cxNEhielBxdzQM/D3EFB0C52E0C6FD06FA36F7D5E413993EB5B33D9.90DD45248D796A1FCF6B0E3031CDB810A641A0D6/yt6/1/video.3gp
it dont change anything still has the default mplayer user agent
how will i go around changing that to a custom one anybody kindly assist
The mplayer help explain this is for HTTP:
-user-agent
Use as user agent for HTTP streaming.
If you look at mpayer source code demux_rtp.cpp you will see that there is no way to specify the user-agent string used by RTSPClient.
In order to set it you could call the live555 API of class RTSPClient:
void setUserAgentString (char const *userAgentName)

Load settings view from code

I'm working on an extension and I'm checking to see if settings have values, if not, I want to show an error and provide a button that launches the settings editor so the user can add those settings.
I think my path forward is to use executeCommand and provide a built in command that does this for me, but I've been having trouble finding a list of built-in available commands.
Hidden in the key-bindings section of the documentation, I found the command I was looking for - workbench.action.openGlobalSettings
The full solution looks like
commands.executeCommand('workbench.action.openGlobalSettings');

Audio recording with HTML5 Web Audio Api

Does anyone know if the Web Audio API provides the ability to save audio played using the WebAudioContext?
I actually wrote a small utility called RecorderJS that might help.
There is a startRendering function in Chrome at least (haven't checked Safari). I think it's undergoing some rework and thus isn't included in the spec, but might be added at a later stage (or not). If you want to check out the current implementation, have a look at the answer at Is there a way to use the Web Audio API to sample audio faster than real-time?
There is a W3C specification for a recording API http://www.w3.org/TR/mediastream-recording/ , but as of now it is being implemented only in Firefox.
Client side there is available only the ScriptProcessorNode hack (which is what Record.js is based on).
Alternatively, for some use cases it might make sense to stream the audio to a server using WebRTC and write a server side recorder using Libjingle.
This library work fine, web audio api only (meaning no i.e users):
https://github.com/higuma/web-audio-recorder-js
But we can fairly use it now:
http://caniuse.com/#feat=audio-api
Anyway like you said your sound is already in an audiocontext, so I think you are looking for how to use the AudioDestinationNode, the final node of the web audio api. As soon as you can playing your audio through a regular html audio player, you will gain the record function on right click, like playDataUri do. You need to add the attribute "controls" to the player, or you can make a special link with download attribute.
I made a small enhancement of the Mdn script to send the data to an player, it should give you a good idea:
var audioCtx = new AudioContext();
var source = audioCtx.createMediaElementSource(myMediaElement);
myMediaElement = document.createElement("audio");
myMediaElement.setAttribute("autoplay", true);
myMediaElement.setAttribute("src", uri);
myMediaElement.setAttribute("controls", "controls");
document.getElementById('player').appendChild(myMediaElement);
source.connect(audioCtx.destination);
The AudioDestinationNode interface represents the end destination of
an audio graph in a given context — usually the speakers of your
device. It can also be the node that will "record" the audio data when
used with an OfflineAudioContext.
https://developer.mozilla.org/en-US/docs/Web/API/AudioDestinationNode
This is now available in the latest browsers, its called media recorder you can find more information here
Easiest way is to create a stream as
var dest = audioCtx.createMediaStreamDestination();
var options = {
audioBitsPerSecond : 320000,
sampleSize: 16,
channelCount: 2,
mimeType : 'audio/ogg'
}
var mediaRecorder = new MediaRecorder(dest.stream, options);
var chunks = [];
var isrecording = "Not Recording";
function rec(){
mediaRecorder.start();// start record
dataavailable = true;
isrecording = mediaRecorder.state;
}
you can can check out an example of my soundrec
App here. Although its also a full on Multiband compressor and 5 band paragraphic here.
Oh and if you check out my link . the most important thing to get your head around is the ondataavilable method. And Saving as a blob is a bit of ahead bash too.
Ps if anyone wants to help me get this working on chrome sen me an Email. Thanx.
It will only work in Firefox at the moment.
MultiBand Compressor

TinyMCE: Copy-Paste from Google Docs

Folks,
My company needs to support the following workflow:
- There's rich content getting created in Google Docs (with simple formatting - bold/italic, as well as hyperlinks)
- That content is then pasted into an internal CMS that uses TinyMCE.
Problem: all formatting gets lost when pasting stuff in.
Already tried the "paste from Word" plugin - it doesn't work.
Please advise. Thank you!
UPDATE:
I narrowed the problem down to Google Chrome. Firefox works just fine. I also used the paste_pre_processing() callbacks - the data gets corrupted before getting in there.
I ended up giving up on the Paste plugin into TinyMCE. Instead, I used the undocumented valid_styles property of TinyMCE. This solved the problem fine for my scenario. Here's the config snippet we ended up using:
valid_elements: "a[href|title|target],del,b,strong,del,i,blockquote,p,br,em,ul,li,ol,span[style]",
valid_styles : { '*' : 'font-weight,font-style,text-decoration' },
I know this question was asked a long time ago however I am making an application that requires a copy and paste from google drive into tiny mce. This is actually fairly simple with the free paste plugin. Simply remove the filters so that it can copy in all of the data.
tinymce.init({
selector: 'textarea',
plugins: "paste",
paste_data_images: true,
paste_enable_default_filters: false,
paste_remove_styles_if_webkit: false
});
Your problem is a somewhat complex issue.
First you need to make sure that tinymce does not remove tags and tag-attributes that it recognises as invalid (have a closer look at the tinymce configuration options valid_elements and valid_children).
Second you will have to implement an own handling of the paste process.
There are three way to do this. The most time consuming option is to write an own custom paste plugin and replace the given one. The other options are ways to configure the paste plugins and define own functions to interact with and change the pasted content.
The seetings paste_pre_processing and paste_post_processing are the way to go here.