google tv HTML5 template video not playing - google-tv

I have downloaded the HTML5 Template2 for Google TV, I have modified the DataProvider.js file in order to hard-code my videos, video-thumbnails links & info.
This site works very well on a chrome browser when running on a computer.
here is my site
http://mob11.zxq.net/
I made an APK with Phonegap for android and it plays very well for my Nexus7.
However, when I downloaded the same APK to my Visio-Co start google tv buddy box, the app display perfectly but the videos don't play at all.
Also When I try to go on my site using the chrome browser inside google tv, the site itself display properly, but again the videos don't play.
This is a sample of what my dataProvider.js looks like
var gtv = gtv || {
jq: {}
};
/** * DataProvider class. Defines a provider for all data (Categories, Images & Videos) shown in the template.
*/
gtv.jq.DataProvider = function() {
};
var x = new gtv.jq.DataProvider();
gtv.jq.DataProvider.prototype.getData = function() {
var tourism = [
{
sources:
['https://s3.amazonaws.com/besthaitivids/tourism/welcometohaiti.mp4'],
title: 'Welcome to Haiti',
thumb: 'https://s3.amazonaws.com/besthaitipic/tourism/touristlogo.jpg',
description: ['Bienvenue en Haiti'],
subtitle: 'La Perle des antilles'
}
];
var data = {
categories: [
{
name: 'Tourisim',
videos: tourism
}
]
};
How can I make the videos play on chrome when I access my site inside google tv?
How can I make the videos play in my Google APK APP installed on my Visio-costar google tv?
Any help will be greatly appreciate thanks so much.

Related

How to turn a Phaser web game into Facebook instant game?

I made a simple web game using Phaser.io and I now I would like to turn it into a facebook instant game. I've tried following some articles but it didn't work.
Do you know any good source (article, youtube tutorial...) about the process of making a facebook instant game from a web game?
To host a Phaser Web Game to Facebook Instant Games, follow these steps:
First, you need to create a new Facebook app.
You will now land on the app dashboard, now you will select “Settings”, then “Basic”.
Now in the category select “Games”, then choose the category which fits best to your game.
Back to the dashboard, let’s select “Instant Games”.
Now you have to fill in some information, be sure “Use Instant Games” is set to “Yes”.
Now you have to upload a zipped file with the game. You can do this operation under “Web Hosting” panel, selecting “Upload Version”,
then pushing it to production by clicking on the star icon.
After, you have to include the Facebook Instant Games API in your index file:
<script src="https://connect.facebook.net/en_US/fbinstant.6.0.js"></script>;
Then, in your game file, when you normally create the game itself on window.onload function, you will have to create it this way:
FBInstant.initializeAsync().then(function() {
FBInstant.setLoadingProgress(100);
FBInstant.startGameAsync().then(function() {
var windowWidth = window.innerWidth;
var windowHeight = window.innerHeight;
if(windowWidth > windowHeight){
windowWidth = windowHeight / 1.8;
}
var gameWidth = windowWidth * gameOptions.gameHeight / windowHeight;
game = new Phaser.Game(gameWidth, gameOptions.gameHeight, Phaser.CANVAS);
game.state.add("Boot", boot);
game.state.add("Preload", preload);
game.state.add("TitleScreen", titleScreen);
game.state.add("PlayGame", playGame);
game.state.start("Boot");
})
})
You can check this tutorial for more details & visual instructions.

Using Ionic 3, is there any way to load videos that are restricted via youtube api?

I'm trying to make an app in Ionic for playing youtube videos, however I can't get it to load videos that are domain restricted. When launching ionic in the browser, it works with no issues in chrome but when launching on the phone you get the message "This video contains content from ____. It is restricted from playback on certain sites or applications."
I've researched this pretty extensively and all of the other solutions are not working for me, like setting an origin value in PlayerVars when creating a player or using the iframe tag itself.
In my code i've tried constructing a player with a domain/origin and using a domain/origin with the IFrame tag itself. Both of these do not work. Iframe has the same issue i've mentioned above, and origin in the playervars section comes back with "an error occured, please try again later" and an error id that changes each time.
I believe that this is because of the way ionic uses a headless browser to render the webview and the youtube iframe javascript code not setting an origin/referrer when calling the embedded video.
<iframe id="player" type="text/html"
src="http://www.youtube.com/embed/26yFO5lnkgU?enablejsapi=1&origin=http://www.youtube.com"
frameborder="0"
align="middle"
class='frameplayer'
width="90%"
height="95%"
allowfullscreen
autoplay="1"
origin="http://www.youtube.com" >
</iframe>
Also tried this when constructing my player:
createPlayer(videoId): void {
console.log("creating new player")
let interval = setInterval(() => {
if ((typeof _window.YT !== 'undefined') && _window.YT && _window.YT.Player) {
console.log("making new player...");
this.yt_player = new _window.YT.Player('pa', {
width: '440',
height: '300',
playerVars: {
enablejsapi: 1, //origin considerations when using this
iv_load_policy: '3',
rel: '0',
modestbranding: 1,
autoplay: 1,
controls: 0,
origin: "http://www.youtube.com",
widget_referrer:"http://www.youtube.com"
},
events: {
onStateChange: (ev) => {
this.onPlayerStateChange(ev);
},
onReady : (ev) => {
this.playVideo(videoId);
}
}
});
clearInterval(interval);
}
}, 100);
}
I've tried just origin, and the widget_referrer by themselves and neither of those worked.
Has anyone recently come across this same issue and any fixes? Does youtube let other apps whitelist as approved apps? Also a route i would go down.
Sounds like you might be running into CORS issues.
The iframe API requires you to be launching from a known website so YouTube can verify where the request is coming from.
Given it seems like you’re developing for Android, you should instead use the Native YouTube API.
Ionic implementation here:
https://ionicframework.com/docs/native/youtube-video-player/

Corona Sdk to get integrated with social networks

I just need your help with regards to allow posting on Facebook and Twitter from Corona SDK, and before posting I need to make sure that the facebook or twitter app is being installed on end user device.
Thanks,
You can use plugin CoronaProvider.native.popup.social
-- To use this plugin, add an entry into the plugins table of build.settings. When added, the build server will integrate the plugin during the build phase.
settings =
{
plugins =
{
["CoronaProvider.native.popup.social"] =
{
publisherId = "com.coronalabs"
},
},
}
-- and then in any button event use function
native.showPopup( name, options )
https://docs.coronalabs.com/plugin/CoronaProvider_native_popup_social/index.html
https://docs.coronalabs.com/plugin/CoronaProvider_native_popup_social/showPopup.html
This is pretty universal solution, because it will auomatically give user choises of various socials, where to post, if he have such apk in his device: twitter, facebook, skype, email and so on.

Is there any method to share text from mobile web to wechat by sharing button?

I am looking for wechat sharing function like how whatsapp does.
href="whatsapp://send?text=http://www.example.com"
Based on my research, most of them will be encoded in QR code and scan the QR code with wechat scanner. Is there a way to share the text directly to friend when click on sharing button just like how whatsapp does?
Wechat doesn't have any official deep linking URL for sending a text. However, if you can add some JavaScript Code in your mobile web, you can achieve the share functionality.
Check out Send to chat documentation on Wechat JS SDK.
From JS SDK Documentation:-
wx.onMenuShareAppMessage({
title: '', // Sharing title
desc: '', // Sharing description
link: '', // Sharing link
imgUrl: '', // Sharing image URL
type: '', // Sharing type, such as “music”, “video “ or “link”. It is “link” by default.
dataUrl: '', // The data URL should be provided for items of type “music” or “video”. It is null by default.
success: function () {
// Callback function executed after a user confirms sharing
},
cancel: function () {
// Callback function executed after a user cancels sharing
}
});
We do have some unofficial deep linking URL like you mentioned. But it may stop work anytime if Wechat decided to change it.
Here is some of them below, sadly I don't know any URL to share a text to chat.
weixin:// - to open Wechat app (if installed)
weixin://dl/chat - to open chat screen of Wechat
weixin://dl/moments - to open user moements
weixin://dl/profile - to open user profile
weixin://dl/settings - to open settings page

How To Share Text in Social Networks on FirefoxOS

I'm developing an app for FirefoxOS. This app needs a button that, when pressed, shares some text in social networks and email.
I'm using this code I found somewhere:
var share = document.querySelector("#share");
if (share)
{
share.onclick = function ()
{
var sharing = new MozActivity({
name: "share",
data:
{
//type: "url", // Possibly text/html in future versions,
number: 1,
url: "http://robertnyman.com"
}
});
}
}
It kind of works and I successfully shared pictures. This code opens a menu with all the apps that are available for sharing (Facebook, Twitter, etc). Then you can select any app and it will open that app with an empty textfield that the user can fill with text to share. But I cannot share predefined text at all. I cannot pass this predefined text to the other apps.
As you can see, there's a type parameter that's commented and it says that it'll be available in future versions.
Do you guys have any idea of how to include text in the data variable (or somewhere else) so it can be shared?
Thanks everyone!
I am not sure the Twitter Firefox OS App has a field for the text for the share activity. Another option is to compose the twitter URL and then open it. For example:
var twitterURL = encodeURI("https://twitter.com/intent/tweet?text=test tweet");
var openURL = new MozActivity({
name: "view",
data: {
type: "url",
url: twitterURL
}
})