Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Run a YouTube Video From a QB64 Program?
#1
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.
Reply
#2
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.
The noticing will continue
Reply
#3
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.
Reply
#4
(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 !
Reply
#5
(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.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Run code without compiler phil 9.0 7 1,281 12-05-2024, 08:52 AM
Last Post: phil 9.0
  HELP TO RUN QBASIC CODE FROM 90s ! musss1 12 2,745 06-10-2024, 09:19 PM
Last Post: Kernelpanic
  Can you prevent a QB64 program from being maximized under Linux? Dav 5 1,232 08-07-2023, 12:55 PM
Last Post: Dav
  Auto reload program upon RUN Cobalt 2 862 07-06-2023, 11:08 PM
Last Post: SMcNeill
Photo QB64Shell Don't run gaslouk 5 1,077 02-23-2023, 02:44 PM
Last Post: a740g

Forum Jump:


Users browsing this thread: 1 Guest(s)