Tizen Samsung SDK: How do you play HLS video? - samsung-smart-tv

http://www.samsungdforum.com/TizenGuide/?FolderName=tizen61&FileName=index.html#/TizenGuide/?Foldername=tizen61&Filename=index.html
The above says:
You have two options for multimedia player in Tizen application.
■Use HTML5 tag. It doesn’t support DRMs and streaming engines like DASH, HAS, HLS and SmoothStreaming.
■Use avplay API or Samsung TV
product API. It supports DRMs and streaming engines like DASH, HAS,
HLS and SmoothStreaming.
Is this true? They say it's a private SDK, is that why I can't see any references to it online? And do we need the private sdk to stream HLS at all, or is it only for fancy player stuff?

HTML5 video tag does not supports HLS on Tizen platform.
You need to use AVPlay API to play streaming or DRM content.
Try to test AVPlay (Video Play) Sample in your emulator.

config.xml must content:
<access origin="*" subdomains="true"/>
<tizen:privilege name="http://tizen.org/privilege/internet"/>
in head html file include:
JS:
var init = function () {
console.log('init() called');
var videos = document.querySelector('video');
videos[0].play();
};
window.onload = init;
HTML:
<body>
<video src="file.m3u8" controls></video>
</body>
See also this example: https://github.com/SamsungDForum/PlayerHTML5

Related

How to play DRM content in flutter web version?

Flutter application is implemented for both mobile and web versions. We have a player to stream DRM content. And for android native by using ExoPlayer support we are able to play the DRM content. Below is some package used for providing the license for player.
com.google.android.exoplayer2.source.dash.DashMediaSource
com.google.android.exoplayer2.drm.DrmSessionManager
com.google.android.exoplayer2.source.smoothstreaming.SsMediaSource
com.google.android.exoplayer2.source.ProgressiveMediaSource
com.google.android.exoplayer2.source.hls.HlsMediaSource
Now we would like to play the same DRM content with web version. We are using 'VideoElement' to play the stream url. VideoElement is working fine for normal video url's but we are not finding the way to play DRM content in it. In other way, we are not able to provide license URL in VideoElement of web version to play DRM content.
Present web video player code is mentioned below.
videoElement = VideoElement()
..src = uri
..autoplay = false
..controls = false
..style.border = 'none';
videoElement.setAttribute('playsinline', 'true');
ui.platformViewRegistry.registerViewFactory(
'videoPlayer-$textureId', (int viewId) => videoElement);
Any suggestions to add license url/ play the DRM url.

Can't play some Vimeo videos. Is it possible to set Referer request header on ionic

I have both an Web application and a Mobile (Ionic) application that has this feature to play Vimeo videos uploaded by the user to the Vimeo account configured in the environment.
So in the web application, I'm able to play the video in the component mounting a simple player.vimeo url this way:
function getUrlVimeo(videoid) {
return $sce.trustAsResourceUrl("//player.vimeo.com/video/" + videoid);
}
And so the api request looks like that:
Vimeo API request to play video (web-side) (internal redirect)
Vimeo API request to play video (web-side)
Note the Referer request header: the url that's sent on this header is the web application url.
But I've noticed I can't play the same video on Mobile (Ionic) application probably because of the Referer request header, that is sent correctly when on web application because the browser does it automatically, but the same doesn't happen on Ionic 3 Mobile application.
Code sample inside ngOnInit() method on the page that reproduces the video on Mobile application, this.href is set as the video id for the Vimeo Video component:
console.log('video-link-player-vimeo page .... ngOnInit()');
if(this.isCourse) {
this.href = this.conteudoVideoDetail.data.href;
} else {
this.href = this.trailContent.data.href;
}
var options01 = {
id: this.href
};
this.Vimeo = window['Vimeo'];
this.player = new window['Vimeo'].Player('player_vimeo', options01);
But this causes the following privacy error:
Privacy error on ionic mobile
The API request on Mobile looks like that:
Vimeo API request to play video (mobile - ionic)
I believe if I could set the Referer request header to the the environment url (same as web), it would work, but Ionic automatically sets it to http://localhost/ and I can't seem to find a way to change it.
Is there any way I can do that or overcome this privacy setting error in any way?

How to map a list of videogular2 videos

Based using ionic v.3 to build app. Here is the question:
I have a bulk list of video urls and each time fetch 10 to show on the page.
<vg-player>
<vg-overlay-play></vg-overlay-play>
<video #media1 [vgMedia]="media1" src="{{videourl1}}"></video>
</vg-player>
<vg-player>
<vg-overlay-play></vg-overlay-play>
<video #media2 [vgMedia]="media2" src="{{videourl2}}"></video>
</vg-player>
when in mapping, I can use [vgMedia]="{{video_id}}" to replace, but how about "#media1"?

google tv HTML5 template video not playing

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.

Creating a docked music player for SoundCloud and mp3s

I'm trying to create a website that pulls free songs from multiple sources and lets users play them by clicking on their cover art, and launching them in a docked music player on the bottom of the page. Soundcloud's api offers me a lot of songs, but they are in a streaming api format, not in mp3 form.
The music players that SoundCloud offers are great for these streaming songs, but it won't work with the mp3s I'm pulling from other sites. Mp3 players like Jplayer are great for the mp3s, but I can't figure out how to get it to work with the streaming soundcloud format.
Think of a site like ex.fm: http://ex.fm/search/bob%20dylan
They pull their audio tracks from many sources but it is all playable through their one player.
Any help with this would be great.
Thanks
Check SoundCloud API
http://developers.soundcloud.com/docs/api/reference#tracks
There is a stream_url property for every track that's streamable outside of SoundCloud.
You need to register your app on Soundcloud and get API Key. With that key you can stream the tracks in your own player.
Edit, thanks to gryzzly. Example of SoundCloud API used with jPlayer:
var SOUNDCLOUD_API = 'http://api.soundcloud.com',
CLIENT_ID = '?client_id=REPLACE_WITH_YOUR_CLIENT_ID';
$(document).ready(function() {
var apiRequest;
$.get(SOUNDCLOUD_API + '/tracks/6981096.json' + CLIENT_ID)
.done(handleRepsonse);
function handleResponse (soundData) {
$("#jquery_jplayer_1").jPlayer({
ready: function () {
$(this).jPlayer("setMedia", {
// stream_url is good enough for jPlayer,
mp3: soundData.stream_url + CLIENT_ID
});
},
swfPath: "http://www.jplayer.org/2.1.0/js"
});
}
});
And you can check it live at jsbin.com/ajaken/4/edit