I'm trying to use Youtube API and always get error "ytplayer is not defined".
I've copied the code in http://code.google.com/apis/youtube/chromeless_example_1.html to my .html file, hosted in my computer "ytplayer is not defined". I tried different code but again said "ytplayer is not defined".
What is the problem?
From the YouTube JavaScript Player API Reference:
Note: To test any of these calls, you
must have your file running on a
webserver, as the Flash player
restricts calls between local files
and the internet.
how are you running the application? if its in the air framework, check you haven't got transparency=true set in the configuration. it won't load swf with transparency enabled.
Related
I am new to dart and I am trying to read data from a file and use the contents to draw something canvas. In doing so I am running into 'The built-in library 'dart:io' is not available on Dartium ' issue.
I understand Dart has limitations as Javascript in that code that is running in a browser cannot natively access the File System of the running client.
At the same time are there any tips on how to read a file and also use the contents to write it to canvas?
Thanks in advance.
What kind of application are you trying to build?
If it runs in the browser the files are usually on the server.
If it is a normal web page you can't access user files. There is a sandboxed space accessible to be used by by the code of a webpage.
If you build something like a Chrome app you have less limitations.
You definitely can't import 'dart:io' when the could should run in the browser.
The APIs available in the browser can be found in 'dart:html'.
If you want to build a Chrome app this package provides access to the extended API http://pub.dartlang.org/packages/chrome
I fixed my problem by prompting the user to choose the file. Similar approach as in
https://developer.mozilla.org/en-US/docs/Using_files_from_web_applications but using DART.
Okay so i'm developing an application that supports casting local media to your chrome cast. So far i have connected to my device and have streamed a sample video but I'm know struggerling with streaming local files such as .MP4/.MP3 files that are located in the documents directory of my application. I have tried to use the URL of my file instead of the sample video. However this does not work. I believe this is due to the fact the file path is not within at http:// format however I'm not sure. If i am correct in thinking this How can i get round it?
Here is the code I'm using to stream the google sample video to the chrome cat:
GCKMediaInformation *mediaInformation =
[[GCKMediaInformation alloc] initWithContentID:
#"http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"
streamType:GCKMediaStreamTypeNone
contentType:type
metadata:metadata
streamDuration:0
customData:nil];
Thanks In Advance...
The answer is reasonably simple in the end you just need to serve your files to a http server and play them from there. I used CocoaHTTPServer
Chromecast is accessing shared media through the network. Thus, you should run http server inside your app to provide streaming access to the shared media. It won't work with local file URLs because most probably they are not accessible from the other devices within your network.
I heave just read about google's OAuth2. As a start I tried to download the examples presented here:
https://github.com/borismus/oauth2-extensions/tree/master/samples
but when trying to load them to the chrome browser an error message showed up saying that
the extension can't be loaded because it "could not load javascript oauth2/oauth2_inject.js' for content script".
I've searched the web and didn't find this problem to be mentioned. What should I do in order to solve this issue?
Thanks in advance for any help,
The samples do not contain the OAuth2 libraries. Download the "lib" folder from https://github.com/borismus/oauth2-extensions and place it inside the appropriate extension folder.
I have a website that have an integration against an Alfresco installation through CMIS. The problem is that the content-url that I get from Alfresco is ugly. The major problem is that the filename is "content.xxx" (xxx-being the file-extension).
In another project we have solved this by streaming the document through the website and then to the visitor, but for this case (internal web) that doesn't make any sence and only introduce another source for problems. But I can't make the user to accept content.xxx as filename for all files they are going to use so I need a way to fix this.
Is streaming the file through the website my best choise after all?
It appears that you may be using the deprecated CMIS URLs. When I get the content stream for an object named "test.txt" using the appropriate CMIS URLs and the AtomPub binding (/alfresco/cmisatom) I use the following URL:
/alfresco/cmisatom/1b8980cc-1f1b-4ac3-b26f-17aeee0cefc9/content/test.txt?id=workspace%3A%2F%2FSpacesStore%2Fc20d54f9-01b6-4c80-861b-094c2246ab21%3B1.0
If I then connect using the deprecated URL (/alfresco/s/api/cmis) the content stream URL becomes:
/alfresco/s/cmis/s/workspace:SpacesStore/i/c20d54f9-01b6-4c80-861b-094c2246ab21/content.txt
Can you double-check that you are using the non-deprecated URL and see if this addresses your issue?
I am using appfile:/. The path is correct; if I put it on screen and copy-paste it in the explorer it links to the image.
Is there anything else I need to do?
UPDATED I have updated the library, now is more easy to use. Can you test it?
I am the author of the StageWebViewBridge class. There is a known problem if you are using Android. Anyway, I have a working solution I will update the next week.
If the problem is not in Android, then send me some code.
I am also confused on how to access locally packaged assets. I put them in the HTML folder as requested and when I send a signal to the StageWebViewBridge to set the .src attribute of a video I'm not sure how to do it.
Without StageWebViewBridge and entirely in a website I can just reference the file for a video object via JavaScript directly e.g. swvRef.src = 'file.mp4';. This works perfectly fine. When I try to tell flash to send a call via StageWebViewBridge it does receive the call to the StageWebView (I have JavaScript reporting it). However when I try to set the .src of a video object I can't figure out the correct path.
The documentation says to put all things in a 'html' folder. I did so. No reference to a .src of 'html/a.mp4' or 'a.mp4' or 'htmlCache/a.mp4' ever makes the new javascript html5 video class work.
Bridge otherwise is working perfectly sending AS->JS and JS->AS. I'm just looking for info on how to reference packaged files. I want to play a video I put in the /html folder and so far, I just can't do it.
Got the same issue and fixed it with "appfile:/"
Why do you require "appfile:/ for a local html file ?
If the treated html/js/css is local and asset is relative (aka ../ or no http://) you should treat them as "appfile:/" ?
If the treated file is distant you do not have to handle assets ?
Is there a best practice to work with "appfile:/" ?
Actually I debug my html/js/css game in the browser but if I use appfile:/ it will no longer works. I will have to handle 2 behaviors.