Retiring MP4 Video output

video
rest

#10

Thank you for the great questions. We understand there may be some considerations to make with this change and appreciate your time to dig in thoroughly. Here is an overview of the different methods we offer to display media as well as some additional thoughts and answers.

Video on mobile
Both iOS and Android are able to play back HLS video natively. For display within native mobile apps, you might also consider using Twitter Kit, part of our Fabric mobile development tools, to easily render Tweets with video.

Video on web
For display on web, our embedded Tweets, embedded timelines and embedded video tools are the easiest way to display Tweets with video. You can grab an embed code from a Tweet on twitter.com or use the Tweet URL to integrate it programmatically with the oEmbed API endpoint.

A video in a Tweet can also be easily integrated as a player. You can take advantage of the JavaScript factory function to render a clean, full-bleed video in your page. HLS playback is supported in all embedded products.

Example use of the JavaScript factory function

twttr.widgets.createVideo(
  '695669511052103680', // The ID of the Tweet containing the video
  document.getElementById('container'), // DOM node of insertion point 
  {
    hideStatus: true
  }
);

A screenshot of the player that results

Using direct links to HLS
If you are developing a product with a more custom display that cannot be solved with the above options, you should explore 3rd party solutions that play HLS for the browsers you’d like to support. As @cbal mentioned, a great example is DailyMotion’s hls.js open source project.

We hope this is informative and helpful, but please let us know if you have any further questions.

Some direct responses
@johnbarratt - This change does not affect embedding video, Tweets, or timelines on third party sites. We are dedicated to and continually improve our syndication products. All products including twitter.com currently support HLS for video playback and will work as expected in browsers like Firefox and Chrome.

@bugtrotter - Playback in our embedded products will work on Windows and Linux. If the products above do not fit into your use case and you are using the link in extended_entities, then you should take advantage of a third party player. hls.js may be of interest to you.

@Kimik00 - Firefox is not supporting native playback for HLS. To play HLS video on your site, check out our embedded products or the hls.js project. If you just want HLS to play in Firefox when going to the URL, there are some plugins like mangui/firefox-hls, mentioned in the same thread linked above.

@richardhyland - Definitely check out Twitter Kit as mentioned above, this is the easiest way to get Twitter video in your app.


#11

Thanks for the detailed followup Jon. A few queries on this :

  • The ‘hideStatus’ option isn’t documented in the factory API URL you mentioned, so just wanted to check it is just missing from the current documentation, and it is in fact a fully supported option?

  • Is there a version of this for the html embed using the ‘data-’ value, eg ‘data-hide-status’ or the likes?

  • I have tested out this embed, but it currently loads an insecure image twice (the same one) when loaded on a secure URL (https). This results in loss of padlock in the address bar on the embedding page, and warnings in the console :

    Mixed Content: The page at ‘https://SITE/PATH.html’ was loaded over HTTPS, but requested an insecure image ‘http://pbs.twimg.com/profile_images/530814764687949824/npQQVkq8_normal.png’. This content should also be served over HTTPS. build.min.js:116

(I’d include the exact html I’ve used, but I can’t seem to work out how to embed HTML here and have it display, though it is trivial so you should be able to easily reproduce)

  • FYI, widget.js is loaded over https by using src="//platform.twitter.com/widgets.js"

Thanks,

JB.


#12

Good eye, John :slight_smile: I brought up the same question about ‘hideStatus’ and we’re working to get that in the documentation. It was just added recently for use with ‘createVideo’ and was not published.

I’ll inquire about your other questions regarding data- values and secure URLs.


#13

Thanks Jon, one more thing that we could really use for ‘tweet wall’ like situations is an autoplay option as well for these videos. Tweets autoplay with sound off in your main timeline now on twitter.com, but there seems to be no way to replicate that with the embedded videos. Or is there another hidden option already that does this? (‘autoPlay’,‘autoStart’ don’t seem to work :frowning: ).

Thanks,

JB.


#14

The HLS plays fine on Android - but not in desktop Chrome or Firefox.

If I use the DailyMotion JS, it works on desktop, but not mobile.

If I use the platform.twitter.com/widgets.js my users have to download 102KB of JS - assuming Twitter isn’t blocked in their location. And I’m not sure how that will work for multiple videos.

Is there a better way of doing things?


#15

Two questions:

  1. Am I right in thinking that, once this change happens, there will be no way to get the URL of the actual video file via the API? For example, if I wanted to use the API to download copies of videos I’ve tweeted, it sounds like it will be very difficult / impossible if I can only access the HLS stream… or have I missed something?

  2. Is the MPEG-Dash URL remaining? (I’m not 100% sure what that’s used for, but I was just curious if it’s changing.)


#16

Does this affect Twitter player cards which link to mp4 videos and do those also need HLS formatted video links?


#17

I’m currently having a problem with the embedded timeline videos. None of the Twitter videos are playing. The message I receive is “This browser does not support video playback” for videos that previously played. This change, Retiring MP4 Video Output, which seems to already have happened, is affecting every video in my companies Twitter Timeline. We’re using IE11 / Win 7 platform and using Chrome as the standard is not an option. There are several hundred thousand employees, each with a computer and it takes significant time to make a browser change. When I review the videos source code, I see the .M3U8 file. I’m not sure how to resolve this issue. Any feedback to help would be greatly appreciated.

Thanks,

Joe


#18

@cbal I’m sorry but I’m not sure if I understand well. I’m currently uploading mp4 videos to twitter with TwitterKit.
When you say MP4 URL will be removed, it means when you tweet a URL or even if the video is created within an app and then uploaded to twitter in MP4 format?
I’m sorry but I don’t really understand if MP4 will not be supported at all or not…

Thanks for your help.

(Edited to remove username mentions - don’t do that unless responding specifically to someone, since not everyone has the same skills or time to reply)


#19

@ChallengeBoom You’ll still be able to upload MP4 videos to Twitter. Well, they haven’t said you won’t be able to, but the API docs don’t mention which formats are OK. And the docs for uploading via Twitter apps and website say:

We currently support MP4 and MOV video formats on mobile apps.

On the web, we support the MP4 video format with H264 format with AAC audio. You can upload videos up to 512MB, however you will be prompted to edit videos to 30 seconds or less in length.

What they’re saying is that if you request the data about a Tweet from the API, there is currently a URL for a video in MP4 format. That URL will be disappearing from 1st August 2016. So to access a video (no matter what format the original uploaded video was) you should use the .m3u8 URL for a streaming version.

If you “tweet a URL” to an MP4 video that won’t change - it’s just a link to a video, not a video attached to the tweet and uploaded to Twitter.


#20

@philgyford Thanks a lot for your help. Really appreciate it!
I understand much better now, thanks a lot for taking the time to clear my doubts! :slight_smile:


#21

Does that mean that the video quality on twitter will be much better?
I have not realized how many users complain about a poor video quality experience! WOW

If someone can explain me how the quality of my video can be original one once uploaded you make my day!


#22

I don’t think there’s anything you can do about the video quality, assuming you’re uploading good quality video. Twitter will process it however they like and provide a streaming version of it. It’s possible that some people who complain don’t have very good bandwidth?


#23

Did this actually go into effect? Cause I’m still seeing MP4s. Am I missing something.


#24

Dear Twitter, this is bad news. When is this change actually going to happen? It’s 7th October and I’m still not seeing m3u8 URLs; the old mp4 links are still working.

Second, I get that introducing HLS makes sense for the reasons stated. But why remove mp4 at the same time - why not both? Most origin video will be mp4 in the first place, and storage is cheap, right? mp4 is supported in all the browsers that count and withdrawing mp4 is going to break many applications (including mine) as they stand. I get that open-source JavaScript players exist for HLS but what a pain to work around this…


#25

Hi Tim,
We’ve had HLS available since the launch of video on Twitter. Can you clarify what API you’re calling and not seeing M3U8’s available?

Thanks!
Josh


#26

Hi,

I stated things wrongly. My code specifically looks for an mp4 URL in extended_entities (after a hashtag search followed by a lookup of each post) and ignores anything else. It’s been a while since I wrote the code and I’d forgotten that. I’ve always found an mp4 in the data for a video.

Now I see that I was actually arguing for the status quo, since you’ve always included M3U8s. What I should have said was: the mp4 URLs haven’t gone away.

Can you tell us when the mp4s will disappear? Or have I got the wrong end of the stick, and they’re not going away?

Thanks


#27

I wish this conversation wasn’t over my head, but I’m afraid it is. What I’m trying to find out is: What, if anything, I can do to make my company’s previously-functional videos (natively uploaded) work in IE again? For instance, https://twitter.com/CTGinc/status/766273528635195392. For me in IE, any video looks like the attached photo. Can anyone offer insight or point to a resource re: options? Thank you.


#28

Hi Christy,
That issue is probably not related to this thread, but is definitely a bug of some kind on our side (and not a problem with your video). That tweet looks fine for me in Chrome on Mac.

I’ll have someone from my team investigate.

Thanks!
Josh


Embed Twitter Moment - video not displaying on IE or Edge
#29

Hi Christy-
There was a widespread issue this morning where popular ad blockers had begun blocking all video playback problems on Twitter.com. Are you running an adblocker? If you force an update of your adblockers block list (or just disable the blocker on twitter.com), is the problem resolved?

Thanks!
Josh