Reputation: 171
ive got link like this "http://trwamtv.live.e96-jw.insyscd.net/trwamtv.smil/playlist.m3u8" and I would like to stream it inside mediaelement ? is there anyone who knows how to do it ?
Upvotes: 0
Views: 1581
Reputation: 1553
The MediaElement doesn't support M3U files inherently. M3Us are playlists, not media files (http://en.wikipedia.org/wiki/M3U). It may be possible to drill down through the playlist files until you get to actual media files, queue these, then have MediaElement play them.
The playlist file you've provided contains three separate links to different resolution versions of the same video clip:
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-STREAM-INF:BANDWIDTH=950000,RESOLUTION=960x540
chunklist_b950000.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=500000,RESOLUTION=640x360
chunklist_b500000.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=250000,RESOLUTION=320x180
chunklist_b250000.m3u8
Notice that each of the 'chunklist' references are to further M3U playlists. Replacing 'playlist.m3u8' in your link with 'chunklist_b950000.m3u8' provides a further playlist file which contains references to 3 MPEG_TS files:
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-ALLOW-CACHE:NO
#EXT-X-TARGETDURATION:12
#EXT-X-MEDIA-SEQUENCE:21565
#EXTINF:10.0,
media-urj3zh3ic_b500000_21565.ts
#EXTINF:10.0,
media-urj3zh3ic_b500000_21566.ts
#EXTINF:10.0,
media-urj3zh3ic_b500000_21567.ts
The WPF MediaElement doesn't support Transport Stream (.ts) files. Unfortunately you'll need to look elsewhere for a solution. I'd recommend looking into Vlc.Dotnet, the WPF MediaKit, MPlayer.Net, or some other third party media control.
Upvotes: 4