Samsung Smart TV Closed Caption Support VOD JavaScript App - samsung-smart-tv

I've been trying to get closed captions working with the SEF player, but haven't had any luck. My app uses playready streams and I've tried side loading the SAMI files, but I get errors. I would prefer to do side loading, but if I can get embedded closed captions to work that would be a first step. There seems to be limited and conflicting documentation and posts on the Samsung developer's forum so I'm hoping to find someone who has gotten this to work on 2012/2013 devices.
Here's what I have tried:
var SefPlugin = document.getElementById('pluginDL');
alert(" " + SefPlugin.Open("Download", "1.000", ""));
alert(SefPlugin.Execute('GetPluginInfo'));
var ret = SefPlugin.Execute('StartDownFile', 'http://testurl.com/test.smi', '$TEMP/subtitle.smi', 10, 10);
alert("SUBTITLE DOWNLOAD RETURNED: " + ret);
The output is:
JS ALERT: 1
JS ALERT: 1
JS ALERT: SUBTITLE DOWNLOAD RETURNED: 1
Then in the OnStreamInfoReady method I attempt to do this:
alert(" START SUBTITLE: " +Player.plugin.Execute("StartSubtitle", '$TEMP/subtitle.smi'));
alert("SET STREAM ID: " +Player.plugin.Execute("SetStreamID", 5, 0));
The output is:
JS ALERT: START SUBTITLE: -1
JS ALERT: SET STREAM ID: 1
The StartSubtitle returning -1 is an error and I'm not sure what the problem is with this scenario.
I also tried the AVPlay plugin by downloading the subtitle file the same way as above. Then, I tried to initiate a play action by calling:
var subtitleDataCallback = (function(syncTime, data) {
alert(syncTime + " : " + data);
})();
Main.AVPlayerObj.open('http://testurl.com/test.mp4',
{
subtitle: {
path: "subtitle.smi",
streamID : 0,
sync : 1000,
subtitleDataCallback: subtitleDataCallback
}
});
It plays the content if I leave out the subtitle object, but when I have the subtitle object there it gives me the following error:
JS ALERT: ======================================= ERROR2: TYPE_MISMATCH_ERR
I tried $TEMP/subtitle.smi for the path as well, but I receive the same mismatch error. Any guidance would be greatly appreciated.

I never actually got subtitle files to work with the player. I found a subtitle parser and ripped it out from (http://mediaelementjs.com/). It gives you each subtitle entry in an array that has the time when the subtitle should start showing and when it should stop showing.

Related

chrome.devtools.network How can I use that method in devtools?

Sorry if I ask easy question
The code is from that link:
https://developer.chrome.com/docs/extensions/reference/devtools_network/
chrome.devtools.network.onRequestFinished.addListener(
function(request) {
if (request.response.bodySize > 40*1024) {
chrome.devtools.inspectedWindow.eval(
'console.log("Large image: " + unescape("' +
escape(request.request.url) + '"))');
}
}
);
When I copy this code to developer tools console, I got error. My aim is catching web pages whose pagesize(transferred size in network section) info is bigger than treshold value.
How can I get thhe value on the photo programmatcally, I am using above code on this purpose.

how to read speaker notes from google slides using flutter?

There is a similar question at:
Can I get speaker notes from Google Slides by API?
and documentation here:
https://developers.google.com/slides/how-tos/notes
But I can't get it working in flutter.
var ssMap = pp.slides.asMap();
ssMap.forEach((key, slide) {
print('Slide: ${key} : ${slide} ');
var notesId = slide.slideProperties.notesPage.notesProperties.speakerNotesObjectId;
print("NOTE: " + notesId.toString());
How do I read speaker's notes?

protractor browser.actions().mouseMove() not showing hover effects

I am new to protractor and trying to add tests for a slider panel which is closed by default and hovering mouse over will open it and then there are a list of items on the slider panel to pick.
<div class="slider" [ngClass]="{ closed: state === 1, open: state === 2}" (click)="onClick($event)" (mouseover)="onMouseOver($event)" (mouseleave)="onMouseLeave($event)">
I tried multiple ways, none of them work.
First attempt:(no hover effect, ie, do nothing)
browser.actions().mouseMove(element(by.css('.slider.closed'))).perform();
Second attempt:( got an error: An invalid or illegal selector was specified)
browser.actions().mouseMove(element(by.css('[(mouseover)="onMouseOver($event)"]'))).perform();
Third attempt: (got an error: No element found using locator)
browser.actions().mouseMove(element(by.css('[mouseover="onMouseOver($event)"]'))).perform();
This should work, unless you have multiple elements with class .slider. At which point, you might try including a parent object, or another locator strategy.
browser.actions().mouseMove($('.slider')).perform();
I used webdriver and made it work. browser.executeScript('arguments[0].click()',browser.driver.findElement(By.css('.slider')));
I just have the same problem, after 2 hours, I found this work for me:
src: java mouse over using javascript
let loginElement = await driver.findElement(By.id('header-user'));
let strJavaScript = "var element = arguments[0];"
+ "var mouseEventObj = document.createEvent('MouseEvents');"
+ "mouseEventObj.initEvent( 'mouseover', true, true );"
+ "element.dispatchEvent(mouseEventObj);";
await driver.executeScript(strJavaScript, loginElement);
I got the same issue when run tests with firefox
and find out a solution as below
if (browser.isFirefox) {
var script = `if(document.createEvent) {
var evObj = document.createEvent('MouseEvents');
evObj.initEvent('mouseover', true, false);
arguments[0].dispatchEvent(evObj);
} else if (document.createEventObject) {
arguments[0].fireEvent('onmouseover');
}`;
browser.executeScript(script, elm.getWebElement());
return elm.click();
} else {
return browser.actions()
.mouseMove(elm.getWebElement())
.click()
.perform();
}
Test with:
Protractor: 5.1.1
Selenium: 3.4.0

How to Download Facebook Look back Video?

What should Do, If I want to download Facebook Lookback Video
Reference
Simple JS Script to get Video URL from Facebook's Look Back
Copy paste this whole code into Chrome Console and press enter.
You can execure this script on any page on Facebook.
It will give you the video URL, open it, view it, download it, do whatever you want to. :P
The video URL will popup in front of you, press Ctrl + C to copy it.
To do so, open Chrome Console, Ctrl + Shift + J, "Console" tab.
Copy paste the whole thing there.
To share it, just open the link and download it by pressing Ctrl + S.
Upload it to YouTube or wherever you want to. Share, enjoy! :)
Keep Sharing this with everyone! :)
var xmlhttp;
if (window.XMLHttpRequest) {
xmlhttp = new XMLHttpRequest();
} else {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
ss = xmlhttp.responseText.split('[["params","')[1].split('"],["width","960"]')[0];
var x = ss;
var r = /\\u([\d\w]{4})/gi;
x = x.replace(r, function (match, grp) {return String.fromCharCode(parseInt(grp, 16)); });
x = unescape(x);
console.log(JSON.parse(x).video_data[0].hd_src);
prompt("Here's your video URL (HD)! Press Ctrl + C to copy it!", JSON.parse(x).video_data[0].hd_src)
}
}
xmlhttp.open("GET", "/lookback", true);
xmlhttp.send();
You can also get the SD and HD sources directly from the flashvars of the embed used to display the video. In Google Chrome inspect the page for the "content" div you'll find a div with class "swfObject".
Decoding the flasvar, you'll get something similar to:
params={
"autoplay":true,
"autorewind":true,
"default_hd":false,
"dtsg":"AQAAJp6S",
"inline_player":false,
"lsd":null,
"min_progress_update":300,
"pixel_ratio":1,
"preload":false,
"source":"lookback",
"start_index":0,
"start_muted":false,
"use_spotlight":false,
"video_data":[
{
"hd_src":"https:\/\/lookbackvideo7-a.akamaihd.net\/hvideo-ak-ash2\/v\/t55\/1774977_10104243234253383320144_17978_n.mp4?oh=7d70ce01b4c6dff2345d48e6e938a9df65f&oe=52F59B08&__gda__=1391855368_9ae234b1cce92effd53d05cdfb6e884f323",
"is_hds":false,"index":0,"rotation":0,
"sd_src":"https:\/\/lookbackvideo7-a.akamaihd.net\/hvideo-ak-ash2\/v\/t54\/1785524_101045234234383320144_19170_n.mp4?oh=1116ee0f06e59c4180648234bac62a148ea&oe=52F5A983&__gda__=1391848771_03b13324ffa3791cc64e0d070465107c7c8",
"thumbnail_src":"https:\/\/fbcdn-vthumb-a.akamaihd.net\/hvthumb-ak-prn1\/t15\/1542287_101045533833922349984_10104553383320144_60544_503_b.jpg",
"thumbnail_height":540,"thumbnail_width":960,
"video_duration":62,
"video_id":"101045523423383320144"
}]}
The two important values here are hd_src and sd_src (i've garbled mine for security purposes):
"hd_src":"https:\/\/lookbackvideo7-a.akamaihd.net\/hvideo-ak-ash2\/v\/t55\/1774977_10104553382342320144_17978_n.mp4?oh=7d70ce01b4c6dff5d48e6e938234a9df65f&oe=52F59B08&__gda__=1391855368234_9aeb1cce92effd53d05cdfb6e884f323",
"sd_src":"https:\/\/lookbackvideo7-a.akamaihd.net\/hvideo-ak-ash2\/v\/t54\/1785524_101045532342343320144_19170_n.mp4?oh=1116ee0f06e59c4180623424448bac62a148ea&oe=52F5A983&__gda__=139184232428771_03b13ffa3791cc64e0d070465107c7c8",
Load your desired quality (High Definition or Standard Definition) URL into a new browser window, right click on the video and "Save Video As."
www.fundawn.com is the best web place where people can download and watch public videos and photos of top facebook celebrities and others, all in one place.
Just check it.

Extract image data from camera roll on Android?

Can anyone help me find out if/how you can get image data off of the 'camera roll' in an Android device, using (Appcelorator) Titanium ? I have found a 3rd party module for IOS that does this but I am desperate to find one for Android. Otherwise I'll have to scrap the Titanium and go true native.
What I need is a function that returns an array of data about the images on the device. Although I would love to get 'geolocation' data ( if it exists ), all I really need is a 'create date', and a path to the image, or the actual TiBlob.
Seems simple but i get no responses on the Appcelerator forums, which worries me. There must be at least an Android 'module' that achieves this?
Ti.Media.openPhotoGallery({
allowEditing : true,
success : function(event) {
var image = require('/modules/parts/squarecropper').crop(event.media);
setImage(image);
Ti.Media.hideCamera();
},
cancel : function() {
},
saveToPhotoGallery : false,
mediaTypes : [Ti.Media.MEDIA_TYPE_PHOTO],
});
The above method would do your job. Now then either access it directly or get into a file system and encode and decode the data.
var f = Titanium.Filesystem.getFile(currIamge);
var temp = f.read();
var encodeData = Ti.Utils.base64encode(temp);
alert("encodeData = "+encodeData);