Here is my code, please help.
jwplayer("myElement").setup({
playlist: [{
sources: [{
file: "rtmp://draco.streamingwizard.com/wizard/_definst_/demo/sample.mp4"
}],
image: "vtts/bbb-splash.png"
}],
width: 480,
height: 270,
type:"video/mp4"
});
You're using RTMP, which is a Flash protocol. There is no Flash on any mobile device. You'll need to provide an HLS stream or MP4 fallback for mobiles.
Related
I have a mobile application that embeds some youtube videos in a webview.
The problem is that, using YouTube Data API v3 I get a list of "Embeddable" items to show. But some of them say that "Video unavailable". When I paste the same code on on jsfiddle or a domain or some sort of webserver, it does work but when reading from File or navigating to html string via webview, it doesn't work.
My question is that how can I understand if the video that I'm trying to embed is actually embeddable from file or not?
I have checked youtube data API v3 outputs for each video and I couldn't find any meaningful information.
Is there some other sort of web api or http endpoint that I can check to see if the video is right?
If not, how can I get data from youtube player programatically to see whether it successfully embedded it or not?
The sample list of the youtube videos that can't be embedded in file are following:
https://www.youtube.com/watch?v=TjI3bzvbCU4
https://www.youtube.com/watch?v=QWveXdj6oZU
https://www.youtube.com/watch?v=KEEnap_h8cs
Note: My problem is to identify the unimbeddable items, because I want to load them from file (in a mobile app). Therefore trying to loading it from a webserver isn't an option for me.
Note 2: These blocks aren't regional, they are domain based.
YouTube Data API v3 provides a not working embed page while it says that it is.
While for other videos like this one (ZqYezph-hgg) it works.
So my idea is just to retrieve https://www.youtube.com/embed/VIDEO_ID and see if the video is unplayable like this for instance:
curl -s https://www.youtube.com/embed/TjI3bzvbCU4 | grep "UNPLAYABLE" | wc -l
Returns 1, so this video is unplayable.
curl -s https://www.youtube.com/embed/ZqYezph-hgg | grep "UNPLAYABLE" | wc -l
Returns 0, so this video is playable.
I found this entry on Google Support that might explain why a video is not available.
Quote:
Actually found the issue here. The videos that were displaying this on
embed had "Copyrighted" music playing in the background. YouTube
apparently does not play videos like this while embedded. We had our
user remove the audio and re-uploaded the video and everything is
working fine now.
Hope this helps somebody.
Probably, YouTube Data API is not updated for match the value set by the uploader/owner of the video AND YouTube guidelines for allow embed the videos.
For this case, I suggest you to post a ticket on Issue Tracker.
If you enter to the source code of the video - like: view-source:https://www.youtube.com/embed/TjI3bzvbCU4, you can find there a property called previewPlayabilityStatus as follows:
"previewPlayabilityStatus": {
"status": "UNPLAYABLE",
"reason": "Video no disponible",
"errorScreen": {
"playerErrorMessageRenderer": {
"reason": {
"runs": [{
"text": "Video no disponible"
}]
},
"proceedButton": {
"buttonRenderer": {
"style": "STYLE_DEFAULT",
"size": "SIZE_DEFAULT",
"isDisabled": false,
"text": {
"simpleText": "Mirar en YouTube"
},
"navigationEndpoint": {
"clickTrackingParams": "CAEQ8FsiEwiT6sGfg6j3AhVG25QJHY96Amgu003d"
This info was available throught this endpoint: https://www.youtube.com/get_video_info?video_id=TjI3bzvbCU4, but, now, an HTTP ERROR 410 is returned.
Unfortunately, this info does not provide any useful data about the reason(s) why the video is not available - despite the fact the response of the YouTube Data API says is is embeddable:
"status": {
"uploadStatus": "processed",
"privacyStatus": "public",
"license": "youtube",
"embeddable": true,
"publicStatsViewable": true,
"madeForKids": false
},
You can also use this alternative for embed a YouTube video - I share it here because I find it interesting.
Make sure you have your referer and referer-policy set in the header all requests.
When I configured Twilio programmable video using following code:
Video.connect(token, {
name: roomName,
audio: true,
logLevel: 'info',
maxAudioBitrate: 16000,
video: { frameRate: 30, width: 1260, height: 650, controls: false },
})
In some of the devices such as Ipad tab or mobile phones, user is connecting to back camera instead of front camera of device.
Is there a way for us to specify the constraints to make sure Twilio video is always connecting to only front camera. Thanks!
Twilio developer evangelist here.
I wrote about how to select cameras in JavaScript here. If you are trying to ensure you select a user facing camera, then you want the facingMode constraint. Set facingMode to user and you will select user facing cameras on a system that supports it.
Video.connect(token, {
name: roomName,
audio: true,
logLevel: 'info',
maxAudioBitrate: 16000,
video: {
frameRate: 30,
width: 1260,
height: 650,
facingMode: "user"
},
});
Note that I don't believe controls is a valid media constraint, so I have removed that from the code above.
I'm trying to upload a video using the YouTube API.
I'm using the code snippet provided in the documentation page:
https://developers.google.com/youtube/v3/docs/videos/insert
I'm using the Python API.
I'm running this after providing a valid client secret file and file to upload.
I was able to authenticate using auth2, and provide a valid token.
I'm getting the following response:
{'kind': 'youtube#video', 'etag': '"wdgS91PsEbtTfi20GmzFuZzYg2s/75EL94ZW60lJpJbXGn80dBaJI00"', 'id': 'Rz0n45vusps', 'snippet': {'publishedAt': '2020-05-30T05:23:07.000Z', 'channelId': 'UCAfompGqO1DYLi1WZ9GPYiw', 'title': 'Test video upload.', 'description': 'Description of uploaded video.', 'thumbnails': {'default': {'url': 'https://i9.ytimg.com/vi/Rz0n45vusps/default.jpg?sqp=CIDax_YF&rs=AOn4CLCt23wHAw-ViyVPCn5Sbxdh0v9Nzw', 'width': 120, 'height': 90}, 'medium': {'url': 'https://i9.ytimg.com/vi/Rz0n45vusps/mqdefault.jpg?sqp=CIDax_YF&rs=AOn4CLCshm-pBB2CeHW5ynQkhS4TA7zBWA', 'width': 320, 'height': 180}, 'high': {'url': 'https://i9.ytimg.com/vi/Rz0n45vusps/hqdefault.jpg?sqp=CIDax_YF&rs=AOn4CLDwNiO2tURd2POhFKrYOh6vYTfN6A', 'width': 480, 'height': 360}}, 'channelTitle': 'jvalansi84', 'categoryId': '22', 'liveBroadcastContent': 'none', 'localized': {'title': 'Test video upload.', 'description': 'Description of uploaded video.'}}, 'status': {'uploadStatus': 'uploaded', 'privacyStatus': 'private', 'license': 'youtube', 'embeddable': True, 'publicStatsViewable': True}}
But I'm not seeing the actual video in my uploads.
What am I missing?
The problem was that the video was a duplicate. I first uploaded manually, and then tried to use the API.
It would make sense to have some kind of feedback that the video is a duplicate through the API though.
A small percentage of our users don't seem to have a default live broadcast on YouTube even though live streaming is enabled on their channel.
Here's the query I'm using:
youtube.liveBroadcasts
.list({
part: 'snippet,contentDetails,status',
mine: true,
broadcastType: 'persistent',
})
Here's a normal response:
{ kind: 'youtube#liveBroadcastListResponse',
etag: '"XI7nbFXulYBIpL0ayR_gDh3eu1k/tnMgqhFvImsLcGAkkJ86gMVeu7o"',
pageInfo: { totalResults: 0, resultsPerPage: 5 },
items:
[ { kind: 'youtube#liveBroadcast',
etag: '"XI7nbFXulYBIpL0ayR_gDh3eu1k/FqKww8uAZT-v7cY4LAc70S74LZE"',
id: 'jW9y9FCovHs',
snippet: [Object],
status: [Object],
contentDetails: [Object] } ] }
But for some channels, it returns an item with no data:
{ kind: 'youtube#liveBroadcastListResponse',
etag: '"XI7nbFXulYBIpL0ayR_gDh3eu1k/6A_Pgj2FJo4w0Hg6io_OE8jCrzY"',
pageInfo: { totalResults: 0, resultsPerPage: 5 },
items:
[ { kind: 'youtube#liveBroadcast',
etag: '"XI7nbFXulYBIpL0ayR_gDh3eu1k/vyGp6PvFo4RvsFtPoIWeCReyIC8"' } ] }
These users will often have other past live broadcast, but no default.
The snippet.isDefaultBroadcast section in the docs says that each channel with live streaming enabled should have a default broadcast. Any ideas? Is there something different about certain channels that would cause this?
You can read the documentation about how default broadcast work. It says that when a channel starts streaming video to its default stream, the video is visible on the channel's default broadcast. When the stream ends, YouTube converts the completed broadcast to a YouTube video and assigns the video a YouTube video ID. I think this will only modify by the owner of the channel.
Via the Youtube API, how can I detect if a video Youtube is unavailable (ex : https://www.youtube.com/watch?v=5nRZlcB2jPY) ?
Thanks
This is also partially possible without API. Let's say you want to see if the following video is available:
https://www.youtube.com/watch?v=esDJPiGu5x0
The ID of the video is shown as the GET parameter v. Use this one to request the following thumbnail:
https://img.youtube.com/vi/esDJPiGu5x0/0.jpg
If the content of the response has a length of 0 and/or the http response code by youtube.com is 404, then the video is not available anymore.
You would make an API call for the video status.
https://www.googleapis.com/youtube/v3/videos?id=VIDEOID&part=status&key=APIKEY
Then check the uploadStatus in the json result:
"status": {
"uploadStatus": "processed",
"privacyStatus": "public",
"license": "youtube",
"embeddable": true,
"publicStatsViewable": true
}