QB64 Phoenix Edition
Run a YouTube Video From a QB64 Program? - Printable Version

+- QB64 Phoenix Edition (https://qb64phoenix.com/forum)
+-- Forum: QB64 Rising (https://qb64phoenix.com/forum/forumdisplay.php?fid=1)
+--- Forum: Code and Stuff (https://qb64phoenix.com/forum/forumdisplay.php?fid=3)
+---- Forum: Help Me! (https://qb64phoenix.com/forum/forumdisplay.php?fid=10)
+---- Thread: Run a YouTube Video From a QB64 Program? (/showthread.php?tid=4208)



Run a YouTube Video From a QB64 Program? - Magdha - 12-13-2025

I'm embarrassed to ask this, but is there a way to run a YouTube program from a QB64-created program - by clicking on the URL as you would elsewhere?  I have a project which I'm updating from v2 to PE.  It works in v2, but there is an animation within the program that doesn't work in PE.  So I've created a YouTube video of that.  If there were a "click here to view YouTube video" function, that would work well.  As such a function doesn't appear in the Wiki, I already know the answer.


RE: Run a YouTube Video From a QB64 Program? - SpriggsySpriggs - 12-13-2025

The animation used to work in v2 but not in v4.2? Can you elaborate on that? Also, you can use
Quote:SHELL _HIDE _DONTWAIT "start " + youTubeLink$
It will open the YouTube video in the default browser.


RE: Run a YouTube Video From a QB64 Program? - ahenry3068 - 12-13-2025

I would add the following

Code: (Select All)

DIM SHARED OpenCMD AS String

$IF WINDOWS THEN
      OpenCMD = "start "    ' REM space at the end IS REQUIRED
$ELSE
   $IF MAC THEN
      OpenCMD = "open "
   $ELSE
      OpenCMD = "xdg-open "
   $END IF
$END IF

TubeLink$ = "https://youtu.be/dQw4w9WgXcQ?list=RDdQw4w9WgXcQ"

SHELL _HIDE _DONTWAIT OpenCMD + TubeLink$


END

I like to make my source code OS independent as much as possible.


RE: Run a YouTube Video From a QB64 Program? - ahenry3068 - 12-13-2025

(12-13-2025, 11:23 AM)Magdha Wrote: I'm embarrassed to ask this, but is there a way to run a YouTube program from a QB64-created program - by clicking on the URL as you would elsewhere?  I have a project which I'm updating from v2 to PE.  It works in v2, but there is an animation within the program that doesn't work in PE.  So I've created a YouTube video of that.  If there were a "click here to view YouTube video" function, that would work well.  As such a function doesn't appear in the Wiki, I already know the answer.

  In addition to that: 

       The code in my project here: https://qb64phoenix.com/forum/showthread.php?tid=3929

Could be adapted to convert and Playback that Video in your own Code !


RE: Run a YouTube Video From a QB64 Program? - Magdha - 12-13-2025

(12-13-2025, 12:16 PM)SpriggsySpriggs Wrote: The animation used to work in v2 but not in v4.2? Can you elaborate on that? Also, you can use
Quote:SHELL _HIDE _DONTWAIT "start " + youTubeLink$
It will open the YouTube video in the default browser.

@SpriggsySpriggs Gee! That command works straight out the box, thanks.  I never think of Shelling out when I'm coding.  Really, there should be a competence level to allow people to become members of this forum.  That'd be a bar over which I shouldn't be able to climb.

The project that I'm referring to is one that I'm not working on at present, but it's coming up as part of my translation of old .org programs to PE and this forum.  I'll maybe bring the code here for examination at that time.

Thanks to all.