Advertisement
nicolaiev

jPlayer and NSBasic (RTMP and M3U8)

Jun 6th, 2015
771
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 'Just a small contribution to NSBasic.
  2.  
  3. '"jPlayer is the completely free and open source (MIT) media library written in JavaScript.
  4. 'A jQuery plugin, jPlayer allows you to rapidly weave cross platform audio and video into your web pages."
  5.  
  6. 'At http://www.tobem.com/jPlayer you can see a RTMP (Flash Live Streaming)
  7. 'and a M3U8 (HLS HTTP Live Streaming) example.
  8. 'A Container was used to host jPlayer DIV.
  9.  
  10. 'So, now, you can make Video (NBA Livestream !!) and Audio (BBC Radio Livestream !!) Streaming using NSBasic.
  11.  
  12. 'Media Support:
  13. 'HTML5: mp3, mp4 (AAC/H.264), ogg (Vorbis/Theora), webm (Vorbis/VP8), wav
  14. 'Flash: mp3, mp4 (AAC/H.264), rtmp, flv
  15.  
  16. 'Some more info:
  17. 'HLS http://en.wikipedia.org/wiki/HTTP_Live_Streaming
  18. 'RTMP http://en.wikipedia.org/wiki/Real_Time_Messaging_Protocol
  19. 'jPlayer http://jplayer.org/
  20. 'NBR http://conteudo.ebcservicos.com.br/streaming/nbr
  21. 'NSBasic http://www.nsbasic.com
  22.  
  23. Function PlayButton_onclick()
  24.   jPlayerContainer.jPlayer("play")
  25.   StopButton.disabled = False
  26. End Function
  27.  
  28. Function StopButton_onclick()
  29.   jPlayerContainer.jPlayer("stop")
  30.   StopButton.disabled = True
  31. End Function
  32.  
  33. Function LoadButton_onclick()
  34.   JavaScript
  35.     jPlayerContainer = $("#jPlayerContainer").jPlayer({
  36.         ready: function(event) {
  37.             $(this).jPlayer("setMedia", {
  38.                       title: "NBR",
  39.                       rtmpv: "rtmp://ebcremuxlivefs.fplive.net/ebcremuxlive-ebctvnbr/stream1.flv",
  40.                       m3u8v: "http://ebcremuxlive-live.hls.adaptive.level3.net/manifests/ebcremuxlive-ebctvnbr/live.m3u8",
  41.                       poster: "http://conteudo.ebcservicos.com.br/streaming/images/logo-nbr-nova.png"
  42.             });
  43.         },
  44.         swfPath: "http://www.jplayer.org/latest/dist/jplayer",
  45.         supplied: "rtmpv,m3u8v",
  46.         solution: "html,flash",
  47.         preload: "auto",
  48.         nativeVideoControls: {
  49.            apple: /(ipad|iphone|ipod)/
  50.            },
  51.         wmode: "window",
  52.         size: {
  53.                  width: "300px",
  54.                  height: "220px"
  55.               },
  56.     });                                    
  57.   End JavaScript  
  58.  
  59.   PlayButton.disabled = False
  60.   LoadButton.disabled = True
  61.  
  62. End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement