VLC 3.0 not working with input-repeat=-1 - vlc

This is my first post, not sure this is the correct place for it, if not please let me know.
I have C++ code running using VLCLib (from 0.x to 2.2.8) which works the way I intended.
Background info: I simply do a loadlibrary on libvlc.dll and then do a GetProcAddress on the entry points. (This works fine on both 2.2.x and 3.0)
Here is my new issue/question.
Using 2.2.8 I can play a file and it loops infinitely as requested, running the exact same code with VLC 3.0 plays the file only once, and does not loop/repeat.
// This is the line of code responsible for the looping.
pfnlibvlc_media_add_option(m_pVLCMedia, "input-repeat=-1");
In VLC 3.0 I set the libvlc_MediaPlayerEndReached event, but it never hits, I tried other events as sanity checks such as libvlc_MediaPlayerPlaying and this triggered.
Does anyone know if VLC 3.0 functionality has changed? I searched both the VLC wiki and StackOverflow and I can't find anything on this.
Thanks for the advice,
Marc

So, for the VLC >3.0 you can't add the negative value of "input-repeat" to the parameter. Your string must look like input-repeat=65545 References to the issue - https://github.com/ZeBobo5/Vlc.DotNet/issues/96

Related

Is window.requestFileSystem method is deprecated?

I am currently working on an old iOS app. I don't have much idea about cordova.
I am stuck at one place, where code uses window.requestFileSytem . There is some code in success callback of this function.
When I debug, I found that success callback is not triggered. I am not able to find any thing about this function in latest cordova document however there is some thing in older document.
So I am worrying about is window. requestFilesystem method is deprecated. If so then how can I achieve same thing in latest cordova.
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, onReqFileSystemSuccess, null);
Any help would be appreciated.
Reviewing #iammilinds answer I have to correct my initial statement:
The window.requestFileSystem method is non-standard and should not be used. See the linked MDN docs.
Yet there are code examples containing the window.requestFileSystem method in the documentation for the cordova file plugin here or here (searching for window.requestFileSystem might help as the dcos are pretty large).
So regarding your initial problem: I'm afraid you'll have to debug it. Maybe checking the browser's console might give you a hint what's wrong. Or try to add an error handler to window.requestFileSystem as the last parameter like so:
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, onReqFileSystemSuccess, onErrorLoadFs);
Yes, it's deprecated.
It's implemented only by Chrome as of today.
This is what Mozilla page for Window.requestFileSystem() for this API says:
Non-standard
This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.
Above notice can be seen for several other "Files & Directories" APIs. However, below notice is significant and is read only for this particular API.
Even compared to the rest of the File and Directory Entries API, requestFileSystem() is especially non-standard; only Chrome implements it, and all other browser makers have decided that they will not implement it. It has even been removed from the proposed specification. Do not use this method!
The correct usage is as discussed in this post: How to use window.requestFileSystem of FileSystem API?
window.requestFileSystem = window.requestFileSystem || // Chrome
window.webkitRequestFileSystem; // Others

How to use component from the old indy9 package

I have upgraded Indy9 to Indy10 in Delphi7. Took some time for me to change all the parts with TCP servers and clients but seems like it works nice now.
Now, i noticed one part is still not working, and thats idHTTPserver component.
Our applications web page is using a mootools library. With Indy9 idHTTPserver it works perfectly, however Indy10 does something, which makes browsers fail to display the page.
Besides some other errors, there is this nonsense error like (Firefox Error console output):
Timestamp: 2013.08.07 13:13:56
Error: SyntaxError: missing ] after element list
Source File: http://192.168.100.2:8780/lib/ui/core/mootools-1.2.4-more-yc.js
Line: 103, Column: 60
Source Code:
unction(){var b=["C?","C ","C","C?","C,","C¢","Cƒ","C£","C"","C¤","C.","C?","Ä,","ă","Ä"","Ä.","Ä?","Ä?","ÄŒ","Ĩ","C?
-------------------------------------------------------------^
The actual source code inside this .js is:
long long text ....... function(){var b=["C?","C ","C","C?","C,","C¢","Cƒ","C£","C"","C¤","C.","C?","Ä,","ă","Ä"","Ä.","Ä?","Ä?","ÄŒ","Ĩ","C?","C§","Ä?","ĸ","Ä","Ä'","Cˆ","CØ","C?","C©","CŠ","CR","C<","C«","Äš","Ä>","Ę","ÄT","Ä?","ÄŸ","CŒ","C¬","C¨","C­","C?","C®","C¸","CÆ","Ĺ","Är","Ľ","ľ","Å","Å,","C'","C±","Å?","ň","Ń","Å"","C'","C²","C"","C³","C"","C´","C.","Cµ","C-","C¶","C˜","Cø","Å'","Ř","ÅT","Å"","Å.","Å ","Å?","Å?","ÅŸ","Åš","Å>","Ť","Å?","Ť","Å?","Å¢","Å£","CT","C¹","Cš","Cr","C>","C»","Cœ","C¼","Å®","ÅÆ","Åø","Cæ","C½","C¯","Ž","ž","Ź","År","Å»","ż","C?","C¾","C","C°","CŸ","Å'","Å"","C?","C¦","Aµ"]; ................ long long text
What is happening here?
I took a deep breathe and thought, hey i could just use the old version of idHTTPserver as i still have the source files of Indy9 in the other folder.
If nobody knows how to fix the indy10 HTTPserver, could somebody please tell me how do i use the old version? Just the HTTPserver component (which surely links with 10s of other old indy files).
I tried to include the old sources, but it was becoming a mess, because it would use the idHTTPserver.pas from old version, yet idCustomHTTPserver.pas (this is what happens after i follow the uses of idHTTPserver.pas file) from new version...
To use a different Indy version in one project, set the project search path to Indy\Lib\Core, \Protocols and \System, and instantiate all components in code.
This also has the advantage that you can avoid the uninstall / install steps to switch between different Indy 10 versions.
While this is not the direct answer to my own question in title, this did solve my problem.
I followed the function HTTPserver.WriteContent which led into idHTTPServer.pas, then compared idHTTPServer.pas files of Indy9 and Indy10, the parts about encoding in Indy10 caught my attention.
At line 2039 i have removed the second argument of the write function
FConnection.IOHandler.Write(ContentText, CharsetToEncoding(CharSet));
replaced with
FConnection.IOHandler.Write(ContentText);
This solved my problem. Everything works fine now.
The main problem here was, as commenters have noticed, the extra " symbols.
I was quite stupid because i clicked the link in the firefox console and it opened the javascript file which was of wrong version and for some reason i thought this was what it was supposed to be. Only a bit later i decided to check the actual file on my PC and it turned out that "C"" was not even C, the actual text is this
var b=["À","à","Á","á","Â","â","Ã","ã","Ä","ä","Å","å","Ă","ă","Ą","ą","Ć","ć","Č","č","Ç","ç","Ď","ď","Đ","đ","È","è","É","é","Ê","ê","Ë","ë","Ě","ě","Ę","ę","Ğ","ğ","Ì","ì","Í","í","Î","î","Ï","ï","Ĺ","ĺ","Ľ","ľ","Ł","ł","Ñ","ñ","Ň","ň","Ń","ń","Ò","ò","Ó","ó","Ô","ô","Õ","õ","Ö","ö","Ø","ø","ő","Ř","ř","Ŕ","ŕ","Š","š","Ş","ş","Ś","ś","Ť","ť","Ť","ť","Ţ","ţ","Ù","ù","Ú","ú","Û","û","Ü","ü","Ů","ů","Ÿ","ÿ","ý","Ý","Ž","ž","Ź","ź","Ż","ż","Þ","þ","Ð","ð","ß","Œ","œ","Æ","æ","µ"];
So, i was right. When the whole text goes through CharsetToEncoding, it translates all these single symbol characters into 2 symbols.
I will not accept my own answer as it doesnt really answer the title question and i would love to know if its possible to use a single component of older version while the rest are newer.

How to pass data in body of a HttpConnection in blackberry

Actually I want to pass data in body of a httpconnection.
Using apache httpclient library in blackberry, integrated jar file in my project but getting compilation error while running my project.
Kindly updated me on the same.
I have not tried using Apache HttpClient lib in a BB project before, because I did not for a moment think it would work...
In short, you need the code to be compatible with J2ME, and compilable using the RIM tool chain. And then we get into other problems....
First of, be aware that networking in BlackBerry is NOT as straightforward as one might wish.
Have a look at this video for the back ground theory: Networking Transports on the BB Platform
Ok, then for some code (I assume here you already went through the trouble of obtaining an HttpConnection):
byte [] bodyBytes = getBodyBytesFromSomewhere();
OutputStream out = httpConnection.openOutputStream();
out.write(bodyBytes);
out.flush();
out.close();//If you are done, which I'm guessing you are
The above code is of course very simplistic, and completely ignores all the many, many errors that will occur during network IO.
I would suggest you also look at this API,this forum entry,and this one. OS6.0 also introduced a new HTTP Connection API - can't find a link for that right now (sorry!)

Selenium Web Driver Error

I'm getting a weird error while trying to click on a Capybara Element
I'm using find(:xpath,"//a[contains(text(),'Connect')]").click
(find(:xpath,"//a[contains(text(),'Connect')]").present? return true)
the error I get is:
Selenium::WebDriver::Error::MoveTargetOutOfBoundsError Exception: Element cannot be scrolled into view:javascript:void(0);
i did some research and the only solution i found is that setting the selenium version to 2.16 may fix this issue (i'm using 2.25).
anybody got an idea?
It may happen when the page being tested is not fit into the current window size. If you know such pages where usually these error happening, you may explicitly scroll down before doing the operation on such hidden elements(like click, clear etc). Here the code to explicitly scroll down the page.
In java,
JavascriptExecutor js = (JavascriptExecutor) driver;
js.executeScript("javascript:window.scrollBy(250,350)");
From the times I used selenium webdriver to test .NET apps, I would get that error when the issue was exactly what it sounds like: It's looking for an object on the page that it cant scroll to for some reason. In my case it was because some dialogue boxes would appear without scrollbars and the driver had no way to "scroll the object into view"
Can you watch the execution of your test and see if that's the case? I had some luck rolling back to a previous version of firefox because 15+ was (as of about 2 months ago when I had the issue) unsupported by web driver and had this problem periodically. Rolling back selenium versions may help too.
First step though is definitely to watch the execution of the test and see whats happening though. And a good debugging idea may be to try to work through your steps manually yourself to make sure the test works by hand.
Its also worth noting that for the webdriver to be able to execute click the object actually has to be visible. IsPresent doesnt require that, it just searches the page files. Also an issue I ran into. IsPresent will still return true for objects that are not and cannot be made visible on the page (i.e. something at the bottom of the page that you cant see at the time)
Couple of tips here:
Webdriver should ideally be on the most recent update, it's what most use (Unless you're doing Ruby Automation)
Use css selectors, xpath (Whilst rendered), is almost always heavier on both resources and code.
Try defensive coding, first of all ascertain it exists. There are many ways to do that dependent on what package you are using. In ruby you would do page.has_css?('css_string')

Automatic Typing Textarea/input/form in JavaScript

I've been searching for a way to make a textarea type inside of itself. Unfortunately, even with some google searching, I still don't have a clue? Do you guys know where to start with this?
http://lmgtfy |dot| com is an example, but I'm not sure if they use some other technique...
The lmgtfy people are simply using javascript to change the value of the input. Here is a simple jsfiddle showing the same thing:
http://jsfiddle.net/Caut6/1/
LMGTFY uses javascript. If you visit the site using chrome or some other browser with a debugger, you should be able to pause javascript execution and check out how they do it, then roll or copy your own version.
In Chrome, the pause button is under the Scripts area. Their bundle.js files appears to host the JS you are looking for, it is around 1000 lines of code, but you should be able to see the few functions you need to borrow their implementation.
Hope this helps.

Resources