1

As the title says, I'm looking for (i don't know if it exists) a command line switch, when passed to start chrome browser allows me to read the full path for the element.

I did some reading and it looks like it is not possible in a regular browser environment because of the security concerns.

Why do I need it?

I'm developing a html/js app that will run in a CEF (chromium embedded framework). So knowing the full path of files is not really a security concern. My app has a video tag. I'm generating a file url using:

urls[urlIndex] = webkitURL.createObjectURL(file);

and feeding it to the video tag to play the video like this:

videoHandle.attr("src", urls[index -1]).get(0).play();

It plays well in the chrome browser but when I play in the CEF, it is throwing a

cefclient[1121] <Error>: clip: empty path.

I'm suspecting the CEF is unable to understand the url format generated by the createObjectURL.

blob:file%3A///1bd8d246-9bd4-464d-bb77-412ea877f952

So, I'm trying to feed an absolute path to the video element because that is working fine in the CEF. Hence I need the absolute path of the file. Some thing like this.

videoHandle.attr("src", "file:///C:/movies/test.mp4").get(0).play();

I hope it makes sense. I appreciate any pointers in the regard.

arttronics
  • 9,957
  • 2
  • 26
  • 62
user977505
  • 539
  • 3
  • 9
  • 19
  • If I'm understanding your solution correctly, you're suggesting that I set base to "file:///C:/movies/" and use the file name "test.mp4" w/ the video element. So the base will be automatically appended to the video file. Is that right? The problem is user can select any directory. Once the user has selected a directory, I want to be able to fetch the entire path "file:///C:/movies/test.mp4". – user977505 Dec 17 '12 at 05:17
  • I'll give it shot. Oh I forgot to mention that I'm starting Chrome w/ --disable-web-security and -–allow-file-access-from-files. Chrome works fine (able to play the video) w/ the url generated by webkitURL.createObjectURL(file); but it is the CEF (chromium embedded framework) that I'm having problem w/ and I'm starting CEF also w/ the same arguments. – user977505 Dec 17 '12 at 05:49
  • It doesn't work if I use ///. The problem is not really w/ Chrome or CEF. It is w/ an external library that I use to interpret our encrypted video files. This external library intercepts the call from the video element to lower layers. It is trying to make sense out of the url generated by createObjectURL 'blob:file%3A///1bd8d246-9bd4-464d-bb77-412ea877f952' but opening a stream on top of this fails because only lower layers of chromium can interpret it. So now I'm looking for the code in Chromium that does this interpretation. An one familiar w/ Chromium code, please help. – user977505 Dec 17 '12 at 23:12
  • I think this [**SO Answer**](http://stackoverflow.com/a/11901662/1195891) will help to resolve the URL from the generated blob. – arttronics Dec 18 '12 at 01:18

1 Answers1

0

According to the Chromium Embedded Framework website, HTML5 Audio and Video tags are no longer supported in CEF1.

CEF1: Remove support for HTML5 audio & video tags.


If your are using CEF3 and jwPlayer API, there is a known issue and Bug Report where only the first video frame is displayed (the poster image) but video does not play.

arttronics
  • 9,957
  • 2
  • 26
  • 62