Can not show video (mp4 format) when developing a web app for samsung smart TV - samsung-smart-tv

I'm using the latest Samsung smart TV simulator and developing a very simple app for it: Play a video.
The code is show as below. The code is so simple that I can not find the root cause (can not play video). I verified it on mac safari and chrome web browser.
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>basicexample</title>
</head>
<body background="http://icbd.tv/wp-content/uploads/2012/06/background.jpg">
<video id="video" src="http://www.808.dk/pics/video/gizmo.mp4" autoplay="autoplay">Your browser does not support the video tag.
</video>
</body>
</html>

Samsung SDK does not support autoplay attribute. To play video you need to manualy start it:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>basicexample</title>
</head>
<body onload="document.getElementById('video').play(1)" background="http://icbd.tv/wp-content/uploads/2012/06/background.jpg" >
<video id="video" src="http://www.808.dk/pics/video/gizmo.mp4" autoplay="autoplay">Your browser does not support the video tag.</video>
</body>
</html>
This code plays video on 2011-2013 Emulators. 2010 does not support <video> tag.

Related

VSCode extensions: How do I open a new pane with an http url

In VSCode, is it possible to open a new pane pointing to an http url? I have a server running locally (on port 8080). I want to open it as a WebView. I couldn't find anything that provides this in the WebView API docs.
The functionality I'm looking for is similar to the snippet, except with the url opening in the VSCode editor iteself.
vscode.commands.executeCommand('vscode.open', vscode.Uri.parse('http://locahost:8080'));
You can achieve by using an iframe within webview https://code.visualstudio.com/docs/extensions/webview
// And set its HTML content
panel.webview.html =
`<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Cat Coding</title>
</head>
<body>
<iframe width="100%" height="100%" src='http://locahost:8080'> </iframe>
</body>
</html>`;

VSCODE intellisense stopped working all of a sudden MAC

This morning, I was able to view vscode intellisense suggestions with PIXI.js.
My index.html file:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Fun with PIXI</title>
<script src="node_modules/pixi.js/dist/pixi.min.js"></script>
</head>
<body>
<script type="text/javascript" src="index.js"></script>
</body>
</html>
My index.js:
const app = new PIXI.Application();
document.body.appendChild(app.view);
Serving the file and running index.js is fine. I am just so annoyed that I lost intellisense suggestions for PIXI.js (or any third party libraries). I still do see Intellisense suggestions working for DOM APIs (i.e. document methods, etc...)

Phonegap build 3.7, HTML, window.open redirect on iphone

I am trying to do a simple redirect in a Phonegap built (version 3.7) from the opening index.html to another html (main2b.html) on an iphone with no success. It works fine on Android. This is a simplified test of what I need to do.
If I window.location.href='http://www.google.com' as an example it DOES NOT work. (and yes I have white listed it in my config.xml)
If I window.location.href='main2b.html' it just spins and does NOT work either.
For testing purposes the main2b.html is just a simple 'hello' in a div.
I have tried various pathing options of main2b.html with no success so I feel it is not a pathing issue. Both html files are in the same location.
Here is the code sample. Would appreciate any thoughts. This seems like such a simple thing and cannot figure out what is wrong.
Once this simple test works, I need to do something like this where I will detect if my app is 'offline' and as such go to a different html file. This is why I am doing this before any jquery/mobile init stuff which would come later if I detect I am 'online'.
The index.html code:
<!DOCTYPE html>
<html>
<head>
<title>The Conspiracy Show</title>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1 user-scalable=no, " />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<!-- Phonegap build stuff required ----------- -->
<script src="cordova.js"></script>
<!------------------------>
<script>
function onLoad(){
alert('here at onLoad');
document.addEventListener("deviceReady", deviceReady, false);
}
function deviceReady() {
alert('here at deviceReady')
window.location.href = "main2b.html";
}
</script>
</head>
<body onload="onLoad()">
</body>
</html>
main2b.html looks like this
<!DOCTYPE html>
<html>
<head>
<title>The Conspiracy Show App</title>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8"/>
<meta name="keywords" content="conspiracy Richard Syrett talk show Coasttocoastam paranormal callIn"/>
<!-- Required Stuff for PhoneGap prevent page flickering in iOS----------- -->
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<!-- Phonegap build stuff required ----------- -->
<script src="cordova.js"></script>
</head>
<body style="background:#2D5873;" >
<div align="center" style="margin:0px; padding:0px;">
Hello
</div>
</body>
</html>
I found my own problem. Apparently, in iPhone, if you dont specifically close the splash screen (which can only be done after deviceReady), any redirection will not work. On android, the splash screen close can be done immediately. Anyway, problem solved.

Load Url in Web View Intel Xdk

I want to convert my website to mobile application with Intel XDK. So , how to do this with web view.I want to load the URL on the current web view not open it on a new page with the native browser.
Easy way is to use window.location= to load URL:
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1, user-scalable=no">
<script src="cordova.js"></script>
</head>
<body>
<script>
window.location = "http://www.yourwebsite.com";
</script>
</body>
</html>
Better way is to use InAppBrowser and connection Cordova plugins to load website, so that you can handle connection loss and reload, it will load complete website in background and then display, here is code: https://github.com/krisrak/html5-cordova-webapp

using apple-mobile-web-app-capable and cache.manifest issue

So I have this simple html file
<!DOCTYPE HTML>
<html manifest="cache.manifest"><head>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<title>Test</title>
<meta http-equiv="content-type" content="text/html">
<meta name="HandheldFriendly" content="true">
<meta name="viewport" content="width=320; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
<body marginwidth="0" marginheight="0" topmargin="0" leftmargin="0">
<h1>hello</h1>
</body>
</html>
My cache.manifest is simply
CACHE MANIFEST
I run this website on my local server (localhost). I load it from iphone safari and it works fine. I then stop the server and load it again, and it works, because the offline cache is doing its job. However... if I save the website as a start icon in the iphone dashboard, and then I try to open it with the server stopped it won't load. However... if I open it with the server running at least once (it will work) then I can open it later without problem.
It looks like even though the page was cached in safari, it is not cached in this saved app. Anybody knows how to get around this?
The reason for that is because Safari uses a different cache than WebClips. The fact that is cached in Safari does not mean it will be cached if you create a webClip from it. You need to access the webclip at least once to cache it.