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.
Related
I am developing a video player app for windows using flutter windows.
I want to play a network video and send headers along with the video request
I am using dart_vlc package to do so.
I am setting extras property to send the headers but I doesn't work
Player player = Player(id: 1000);
player.open(
Media.network(
'http://localhost:3000/streamVideo',
extras: {
'videoPath':'this is the video path'
}
),
);
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?
Question:
How do I open a YouTube URL (from my tvOS Application) to the YouTube tvOS Application?
Description:
My url fits the youtube url scheme indicated by apple. The prints I get when I run this (on the actual apple tv device) is as follows:
"Can open shared application url."
"tvOS 10.0 detected"
"Result... false"
So for some reason it's telling me that I'm able to open the url, but then when I attempt to open it. Nothing happens (except for that last print ( see 3. above ))
let url = URL(string: "https://www.youtube.com/watch?v=smOp5aK-_h0")
if UIApplication.shared.canOpenURL(url){
print("Can open shared application url.")
if #available(tvOS 10.0, *) {
print("tvOS 10.0 detected")
UIApplication.shared.open(url){res in
print("Result..." + String(res))
}
} else {
// Fallback on earlier versions
UIApplication.shared.openURL(url)
}
}
Youtube URL Scheme:
Native app URL strings:
http://www.youtube.com/watch?v=VIDEO_IDENTIFIER
http://www.youtube.com/v/VIDEO_IDENTIFIER
Many tvOS devs would like to have an option to play YouTube content in their apps on the AppleTV, which is only possible through the YouTube app. It's up to Google to add support for URL schemes compatible with the ones available in the iOS version of the app and they don't seem motivated to make this extra effort.
While the methods do exist to open a URL in a shared application, it does not seem to be supported (by YouTube?) as of right now.
The best I was able to do was to open YouTube Apple Tv App, but it is unable to play the video I wanted.
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
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.